diff options
author | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2024-01-25 14:25:37 +0000 |
---|---|---|
committer | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2024-02-07 14:59:50 +0000 |
commit | beeb5e3846c8457987711491bcb58a6567870591 (patch) | |
tree | 227cdd91b00f3889a1109d457f968472cb7ee596 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java | |
parent | 0241c0aa14447c99fccecc61e91b35051d6743be (diff) |
Remove Dmaap references from policy-common
- updated dependencies for jakarta.* compabilities
- other dependency updates for security fixes
Issue-ID: POLICY-4881
Change-Id: I979d944fcd21279f618d1bcbfe12e914ba30077f
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java')
-rw-r--r-- | policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java index 48cacaf9..8a2574e1 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java @@ -3,7 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020,2023 Nordix Foundation. + * Modifications Copyright (C) 2020, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,6 +40,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.charset.StandardCharsets; +import java.util.Objects; import java.util.UUID; import org.apache.commons.io.IOUtils; import org.junit.AfterClass; @@ -397,7 +398,6 @@ public class HttpServerTest { server.waitedStart(5000); assertTrue(HttpServletServerFactoryInstance.getServerFactory().get(port).isAlive()); - assertFalse(HttpServletServerFactoryInstance.getServerFactory().get(port).isAaf()); String response = http(portUrl + JUNIT_ECHO_HELLO); assertEquals(HELLO, response); @@ -525,7 +525,8 @@ public class HttpServerTest { .hasMessageContaining("No resourceBase provided"); staticServer.addServletResource(null, - HttpServerTest.class.getClassLoader().getResource("webapps/root").toExternalForm()); + Objects.requireNonNull(HttpServerTest.class.getClassLoader().getResource("webapps/root")) + .toExternalForm()); thrown = catchThrowable(() -> staticServer.addServletClass("/*", RestEchoService.class.getName())); assertThat(thrown).isInstanceOf(UnsupportedOperationException.class) @@ -558,9 +559,11 @@ public class HttpServerTest { HttpServletServer staticResourceServer = HttpServletServerFactoryInstance.getServerFactory() .buildStaticResourceServer("Static Resources Server", false, LOCALHOST, port, false, "/", true); staticResourceServer.addServletResource("/root/*", - HttpServerTest.class.getClassLoader().getResource("webapps/root").toExternalForm()); + Objects.requireNonNull(HttpServerTest.class.getClassLoader().getResource("webapps/root")) + .toExternalForm()); staticResourceServer.addServletResource("/alt-root/*", - HttpServerTest.class.getClassLoader().getResource("webapps/alt-root").toExternalForm()); + Objects.requireNonNull(HttpServerTest.class.getClassLoader().getResource("webapps/alt-root")) + .toExternalForm()); staticResourceServer.waitedStart(5000); assertTrue(HttpServletServerFactoryInstance.getServerFactory().get(port).isAlive()); @@ -583,7 +586,8 @@ public class HttpServerTest { HttpServletServer staticResourceServer = HttpServletServerFactoryInstance.getServerFactory() .buildStaticResourceServer("Static Resources Server", false, LOCALHOST, port, false, "/", true); staticResourceServer.addServletResource("/root/*", - HttpServerTest.class.getClassLoader().getResource("webapps/root").toExternalForm()); + Objects.requireNonNull(HttpServerTest.class.getClassLoader().getResource("webapps/root")) + .toExternalForm()); staticResourceServer.waitedStart(5000); int port2 = port + 1; @@ -592,7 +596,8 @@ public class HttpServerTest { jerseyServer.addServletPackage("/api/*", this.getClass().getPackage().getName()); Throwable thrown = catchThrowable(() -> jerseyServer.addServletResource("/root/*", - HttpServerTest.class.getClassLoader().getResource("webapps/root").toExternalForm())); + Objects.requireNonNull(HttpServerTest.class.getClassLoader().getResource("webapps/root")) + .toExternalForm())); assertThat(thrown).isInstanceOf(UnsupportedOperationException.class) .hasMessageContaining("is not supported on this type of jetty server"); @@ -628,7 +633,7 @@ public class HttpServerTest { } /** - * Performs an http request. + * Performs a http request. * * @throws MalformedURLException make sure URL is good * @throws IOException thrown is IO exception occurs |