From 6805d7a567e50d1257d41e874f6bc090b6080170 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 21 Jan 2022 16:17:20 +0100 Subject: Fixed a unittest so it does not open an http port Issue-ID: CCSDK-3560 Signed-off-by: PatrikBuhr Change-Id: I697f6fa780109f4a8fae399b4da882e06036ec15 --- .../controllers/v2/ConfigurationControllerTest.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'a1-policy-management/src') diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java index b4ff6962..d1c36e62 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java @@ -43,7 +43,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpStatus; @@ -101,6 +103,11 @@ class ConfigurationControllerTest { public ApplicationConfig getApplicationConfig() { return new MockApplicationConfig(); } + + @Bean + public ServletWebServerFactory servletContainer() { + return new TomcatServletWebServerFactory(); + } } @LocalServerPort -- cgit 1.2.3-korg