use of com.checkmarx.sdk.utils.scanner.client.ClientTypeResolver in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ClientTypeResolverTest method checkThatExceptionIsThrown.
private static void checkThatExceptionIsThrown(String url) {
ClientTypeResolver resolver = new ClientTypeResolver(new RestClientConfig());
try {
resolver.determineClientType(url);
Assert.fail("Expected exception, but didn't get any.");
} catch (Exception e) {
Assert.assertTrue("Unexpected exception type.", e instanceof ScannerRuntimeException);
Assert.assertTrue("Exception message is empty.", StringUtils.isNotEmpty(e.getMessage()));
log.info("Got an expected exception");
}
}
use of com.checkmarx.sdk.utils.scanner.client.ClientTypeResolver in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ClientTypeResolverTest method testDetermineClientType.
private void testDetermineClientType(String urlPropName) {
ClientTypeResolver resolver = new ClientTypeResolver(new RestClientConfig());
ClientType clientType = resolver.determineClientType(urlPropName);
Assert.assertNotNull("Client type is null.", clientType);
Assert.assertTrue("Client ID is empty.", StringUtils.isNotEmpty(clientType.getClientId()));
Assert.assertTrue("Scopes are empty.", StringUtils.isNotEmpty(clientType.getScopes()));
}
Aggregations