Introduce rAPP Catalogue API
[nonrtric.git] / r-app-catalogue / src / test / java / org / oransc / rappcatalogue / api / ServicesApiDelegateImplTest.java
1 package org.oransc.rappcatalogue.api;\r
2 \r
3 import static org.assertj.core.api.Assertions.assertThat;\r
4 \r
5 import java.util.Arrays;\r
6 import java.util.List;\r
7 \r
8 import org.junit.jupiter.api.Test;\r
9 import org.junit.jupiter.api.extension.ExtendWith;\r
10 import org.springframework.http.HttpStatus;\r
11 import org.springframework.http.ResponseEntity;\r
12 import org.springframework.test.context.junit.jupiter.SpringExtension;\r
13 \r
14 @ExtendWith(SpringExtension.class)\r
15 class ServicesApiDelegateImplTest {\r
16 \r
17     @Test\r
18     void putValidService_shouldBeOk() {\r
19         ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
20 \r
21         ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
22     }\r
23 \r
24     @Test\r
25     void getServices_shouldProvideArrayOfServices() throws Exception {\r
26         ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
27 \r
28         ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
29 \r
30         assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\r
31         assertThat(response.getBody()).isEqualTo(Arrays.asList("a", "b"));\r
32     }\r
33 }\r