client = client.secure(c -> c.sslContext(sslContext));
}
if (isHttpProxyConfigured()) {
- client = client.proxy(proxy -> {
- proxy.type(Proxy.HTTP).host(httpProxyConfig.httpProxyHost()).port(httpProxyConfig.httpProxyPort());
- });
+ client = client.proxy(proxy -> proxy.type(Proxy.HTTP).host(httpProxyConfig.httpProxyHost())
+ .port(httpProxyConfig.httpProxyPort()));
}
return client;
}
createTask().subscribe(//
value -> logger.debug("DmaapMessageConsumer next: {}", value), //
- throwable -> logger.error("DmaapMessageConsumer error: {}", throwable), //
+ throwable -> logger.error("DmaapMessageConsumer error: {}", throwable.getMessage()), //
() -> logger.warn("DmaapMessageConsumer stopped") //
);
}
@TestPropertySource(properties = { //
"server.ssl.key-store=./config/keystore.jks", //
"app.webclient.trust-store=./config/truststore.jks"})
+@SuppressWarnings("java:S3577") // Class name should start or end with Test. This is not a test class per se, but a mock
+ // of the server.
class MockPolicyManagementService {
private static final Logger logger = LoggerFactory.getLogger(MockPolicyManagementService.class);
@Test
void createClientWithWrongProtocol_thenErrorIsThrown() {
+ AsyncRestClient asyncRestClient = new AsyncRestClient("", null, null);
assertThrows(IllegalArgumentException.class, () -> {
- new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null, null));
+ new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, asyncRestClient);
});
}
doReturn(Mono.error(a1Exception)).when(a1Client).getPolicyStatus(any());
rsp = restClient().get(url).block();
info = gson.fromJson(rsp, PolicyStatusInfo.class);
- assertThat(info.status.toString()).isEqualTo("{}");
+ assertThat(info.status).hasToString("{}");
}
@Test