Skip to content

Commit f2b6842

Browse files
Refactor AST-136023: Use String.format for authentication status log message
Replace string concatenation (AUTH_STATUS + cxValidateOutput) with String.format(PluginConstants.INFO_AUTHENTICATION_STATUS, cxValidateOutput) to be consistent with the error logging pattern. Updated the unit test assertion to verify the formatted string accordingly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 05e631a commit f2b6842

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

checkmarx-ast-eclipse-plugin-tests/src/test/java/checkmarx/ast/eclipse/plugin/tests/unit/runner/AuthenticatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void testDoAuthenticationSuccess() throws Exception {
3434
String result = authenticator.doAuthentication("dummyKey", "--param");
3535

3636
assertEquals("SUCCESS", result);
37-
mockedCxLogger.verify(() -> CxLogger.info("Authentication Status: SUCCESS"));
37+
mockedCxLogger.verify(() -> CxLogger.info(String.format(PluginConstants.INFO_AUTHENTICATION_STATUS, "SUCCESS")));
3838
}
3939
}
4040

checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/runner/Authenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public String doAuthentication(String apiKey, String additionalParams) {
3333
try {
3434
CxWrapper wrapper = new CxWrapper(config, log);
3535
String cxValidateOutput = wrapper.authValidate();
36-
CxLogger.info(AUTH_STATUS + cxValidateOutput);
36+
CxLogger.info(String.format(PluginConstants.INFO_AUTHENTICATION_STATUS, cxValidateOutput));
3737
return cxValidateOutput;
3838
} catch (IOException | InterruptedException | CxException e) {
3939
CxLogger.error(String.format(PluginConstants.ERROR_AUTHENTICATING_AST, e.getMessage()), e);

0 commit comments

Comments
 (0)