Introduce rAPP Catalogue API
[nonrtric.git] / r-app-catalogue / src / test / java / org / oransc / rappcatalogue / api / ServicesApiDelegateImplTest.java
diff --git a/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImplTest.java b/r-app-catalogue/src/test/java/org/oransc/rappcatalogue/api/ServicesApiDelegateImplTest.java
new file mode 100644 (file)
index 0000000..53dfc1a
--- /dev/null
@@ -0,0 +1,33 @@
+package org.oransc.rappcatalogue.api;\r
+\r
+import static org.assertj.core.api.Assertions.assertThat;\r
+\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.junit.jupiter.api.Test;\r
+import org.junit.jupiter.api.extension.ExtendWith;\r
+import org.springframework.http.HttpStatus;\r
+import org.springframework.http.ResponseEntity;\r
+import org.springframework.test.context.junit.jupiter.SpringExtension;\r
+\r
+@ExtendWith(SpringExtension.class)\r
+class ServicesApiDelegateImplTest {\r
+\r
+    @Test\r
+    void putValidService_shouldBeOk() {\r
+        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
+\r
+        ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
+    }\r
+\r
+    @Test\r
+    void getServices_shouldProvideArrayOfServices() throws Exception {\r
+        ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
+\r
+        ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
+\r
+        assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\r
+        assertThat(response.getBody()).isEqualTo(Arrays.asList("a", "b"));\r
+    }\r
+}\r