Fixed a unittest so it does not open an http port 00/126700/1
authorPatrikBuhr <patrik.buhr@est.tech>
Fri, 21 Jan 2022 15:17:20 +0000 (16:17 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Fri, 21 Jan 2022 15:35:15 +0000 (16:35 +0100)
Issue-ID: CCSDK-3560
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Change-Id: I697f6fa780109f4a8fae399b4da882e06036ec15

a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ConfigurationControllerTest.java

index b4ff696..d1c36e6 100644 (file)
@@ -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