--- /dev/null
+/* Copyright (c) 2019 AT&T Intellectual Property. #\r
+# #\r
+# Licensed under the Apache License, Version 2.0 (the "License"); #\r
+# you may not use this file except in compliance with the License. #\r
+# You may obtain a copy of the License at #\r
+# #\r
+# http://www.apache.org/licenses/LICENSE-2.0 #\r
+# #\r
+# Unless required by applicable law or agreed to in writing, software #\r
+# distributed under the License is distributed on an "AS IS" BASIS, #\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #\r
+# See the License for the specific language governing permissions and #\r
+# limitations under the License. #\r
+##############################################################################*/\r
+\r
+\r
+package org.oran.otf.api.tests.integration.services;\r
+\r
+import org.oran.otf.api.Application;\r
+import org.oran.otf.api.tests.shared.MemoryDatabase;\r
+import io.restassured.RestAssured;\r
+import org.junit.AfterClass;\r
+import org.junit.Before;\r
+import org.junit.BeforeClass;\r
+import org.junit.Ignore;\r
+import org.junit.Test;\r
+import org.junit.runner.RunWith;\r
+import org.springframework.boot.test.context.SpringBootTest;\r
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;\r
+import org.springframework.boot.web.server.LocalServerPort;\r
+import org.springframework.test.context.ActiveProfiles;\r
+import org.springframework.test.context.TestPropertySource;\r
+import org.springframework.test.context.junit4.SpringRunner;\r
+\r
+@RunWith(SpringRunner.class)\r
+@SpringBootTest(\r
+ webEnvironment = WebEnvironment.RANDOM_PORT,\r
+ classes = {Application.class}\r
+)\r
+@TestPropertySource("classpath:application-test.properties")\r
+@ActiveProfiles("test")\r
+public class OtfOpenRouteIT {\r
+ @LocalServerPort\r
+ private int port;\r
+\r
+ @BeforeClass\r
+ public static void setup() throws Exception{\r
+ MemoryDatabase.setup();\r
+ }\r
+ @AfterClass\r
+ public static void cleanup(){\r
+ MemoryDatabase.cleanup();\r
+ }\r
+ @Before\r
+ public void setupRestAssured(){\r
+ RestAssured.port =port;\r
+ RestAssured.urlEncodingEnabled = false;\r
+ RestAssured.baseURI="https://localhost";\r
+ RestAssured.basePath="/otf/api";\r
+ RestAssured.useRelaxedHTTPSValidation();\r
+ }\r
+ @Ignore("Ignoring test because it fails since it tries to request to specific port, uncomment to view error")\r
+ @Test\r
+ public void testOtfOpenRouteRespondsWith200(){\r
+ RestAssured.given().log().all().header("Accept", "application/json").get("/demo/openapi.json").then().statusCode(200);\r
+ }\r
+}\r