Skip to content

Commit

Permalink
ZENG-172871: minor refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfhdzg0 committed May 25, 2021
1 parent 9ffb68e commit 12f9bd8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public void testGetLoginInformation() {
// Test passing a null project and still find credentials
StandardCredentials credential = cfgGlobal.getLoginCredentials(project, scmConfig.getCredentialsId());

assertNotNull(credential); // NOSONAR
assertNotNull(credential);
assertThat(String.format("Expected getId() to return %s", TestConstants.EXPECTED_CREDENTIALS_ID), credential.getId(),
is(equalTo(TestConstants.EXPECTED_CREDENTIALS_ID)));

// Test pass the project and find credentials
credential = cfgGlobal.getLoginCredentials(project, scmConfig.getCredentialsId());

assertNotNull(credential); // NOSONAR
assertNotNull(credential);
assertThat(String.format("Expected getId() to return %s", TestConstants.EXPECTED_CREDENTIALS_ID), credential.getId(),
is(equalTo(TestConstants.EXPECTED_CREDENTIALS_ID)));

Expand All @@ -97,12 +97,12 @@ public void testGetLoginInformation() {
project.setScm(scmConfig2);

credential = cfgGlobal.getLoginCredentials(project, scmConfig2.getCredentialsId());
assertNull(credential); // NOSONAR
assertNull(credential);
} catch (Exception e) {
// Add the print of the stack trace because the exception message is not enough to troubleshoot the root issue. For
// example, if the exception is constructed without a message, you get no information from executing fail().
e.printStackTrace();
fail(e.getMessage()); // NOSONAR
fail(e.getMessage());
}
}

Expand Down

0 comments on commit 12f9bd8

Please sign in to comment.