From: elinuxhenrik Date: Wed, 16 Feb 2022 08:51:34 +0000 (+0100) Subject: Fix Sonar issues X-Git-Tag: 1.1.0~7 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f72330be756a47260c319b0757d137767e0c11ab;p=nonrtric%2Fplt%2Frappcatalogue.git Fix Sonar issues Issue-ID: NONRTRIC-717 Signed-off-by: elinuxhenrik Change-Id: I656464ecf49bfe3e5c6680b61bfc8f714e2476a9 --- diff --git a/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java b/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java index 8a66e14..642ca70 100644 --- a/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java +++ b/src/test/java/org/oransc/rappcatalogue/HttpsRequestTest.java @@ -53,7 +53,7 @@ import org.springframework.web.client.ResourceAccessException; properties = { // "server.ssl.key-store=./config/r-app-catalogue-keystore.jks", // "server.http-port=0"}) -public class HttpsRequestTest { +class HttpsRequestTest { @Value("${server.ssl.key-store-password}") private String keyStorePassword; // inject password from config @@ -68,12 +68,12 @@ public class HttpsRequestTest { private AbstractConfigurableWebServerFactory webServerFactory; @Test - public void testSsl() { + void testSsl() { assertEquals(true, this.webServerFactory.getSsl().isEnabled()); } @Test - public void rest_OverPlainHttp_GetsBadRequestRequiresTLS() throws Exception { + void rest_OverPlainHttp_GetsBadRequestRequiresTLS() throws Exception { TestRestTemplate template = new TestRestTemplate(); ResponseEntity responseEntity = template.getForEntity("http://localhost:" + port + "/services", String.class); @@ -82,7 +82,7 @@ public class HttpsRequestTest { } @Test - public void rest_WithoutSSLConfiguration_ThrowsSSLExceptionUnableFindValidCertPath() throws Exception { + void rest_WithoutSSLConfiguration_ThrowsSSLExceptionUnableFindValidCertPath() throws Exception { TestRestTemplate template = new TestRestTemplate(); ResourceAccessException thrown = assertThrows(ResourceAccessException.class, () -> { @@ -92,7 +92,7 @@ public class HttpsRequestTest { } @Test - public void rest_WithTwoWaySSL_AuthenticatesAndGetsExpectedResponse() throws Exception { + void rest_WithTwoWaySSL_AuthenticatesAndGetsExpectedResponse() throws Exception { SSLContext sslContext = new SSLContextBuilder().loadKeyMaterial(ResourceUtils.getFile(keyStore), keyStorePassword.toCharArray(), keyStorePassword.toCharArray()).build();