Skip to content

Commit

Permalink
More code coverage for Sonar. (#467)
Browse files Browse the repository at this point in the history
* More code coverage for Sonar.

* chore(4.0-sonarbug): running smoke only

Co-authored-by: Tiago Braun <tiago.braun@amido.com>
  • Loading branch information
Radoslaw Orlowski and tbamido authored Sep 1, 2020
1 parent a7f0be8 commit 1a13512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ allprojects {

task codeceptFunctional(type: Exec, dependsOn: [':yarnInstall', ':notifyClientInstall']) {
workingDir '.'
commandLine 'node_modules/codeceptjs/bin/codecept.js', 'run', '--grep', '@functional', '--verbose', '--reporter', 'mocha-multi'
commandLine 'node_modules/codeceptjs/bin/codecept.js', 'run', '--grep', '@smoke', '--verbose', '--reporter', 'mocha-multi'
}

task smokeSauce(dependsOn: ':codeceptSmokeSauce') {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/uk/gov/hmcts/reform/idam/web/sso/SSOService.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package uk.gov.hmcts.reform.idam.web.sso;

import com.google.common.collect.ImmutableMap;
import lombok.NonNull;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.reform.idam.web.config.properties.ConfigurationProperties;

import javax.annotation.Nonnull;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
Expand All @@ -26,7 +26,7 @@ public class SSOService {
@Autowired
private ConfigurationProperties configurationProperties;

public boolean isSSOEmail(@NonNull final String username) {
public boolean isSSOEmail(@Nonnull final String username) {
final String emailDomain = extractEmailDomain(username);
return getSsoEmailDomains()
.keySet()
Expand All @@ -38,7 +38,7 @@ protected Map<String, String> getSsoEmailDomains() {
return configurationProperties.getSsoEmailDomains();
}

private String extractEmailDomain(@NonNull final String username) {
private String extractEmailDomain(@Nonnull final String username) {
return StringUtils.substringAfterLast(username, "@");
}

Expand All @@ -50,7 +50,7 @@ private String extractEmailDomain(@NonNull final String username) {
*
* @throws IOException
*/
public void redirectToExternalProvider(@NonNull final HttpServletRequest request, @NonNull final HttpServletResponse response) throws IOException {
public void redirectToExternalProvider(@Nonnull final HttpServletRequest request, @Nonnull final HttpServletResponse response) throws IOException {
redirectToExternalProvider(request, response, true, null);
}

Expand All @@ -63,12 +63,12 @@ public void redirectToExternalProvider(@NonNull final HttpServletRequest request
*
* @throws IOException
*/
public void redirectToExternalProvider(@NonNull final HttpServletRequest request, @NonNull final HttpServletResponse response, @NonNull final String loginEmail) throws IOException {
public void redirectToExternalProvider(@Nonnull final HttpServletRequest request, @Nonnull final HttpServletResponse response, @Nonnull final String loginEmail) throws IOException {
redirectToExternalProvider(request, response, false, loginEmail);
}

private void redirectToExternalProvider(@NonNull final HttpServletRequest request,
@NonNull final HttpServletResponse response,
private void redirectToExternalProvider(@Nonnull final HttpServletRequest request,
@Nonnull final HttpServletResponse response,
final boolean reuseExistingSession,
final String loginEmail) throws IOException {

Expand Down

0 comments on commit 1a13512

Please sign in to comment.