aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrikBuhr <patrik.buhr@est.tech>2022-01-21 16:17:20 +0100
committerPatrikBuhr <patrik.buhr@est.tech>2022-01-21 16:35:15 +0100
commit6805d7a567e50d1257d41e874f6bc090b6080170 (patch)
treee95f6e1d133ca58528e7bc7b31a85ea27cae7879
parent0f8b20544745afaf9c7b38140b9516667d9c4752 (diff)
Fixed a unittest so it does not open an http port
Issue-ID: CCSDK-3560 Signed-off-by: PatrikBuhr <patrik.buhr@est.tech> Change-Id: I697f6fa780109f4a8fae399b4da882e06036ec15
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java7
1 files changed, 7 insertions, 0 deletions
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