aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java
diff options
context:
space:
mode:
authorgolabek <tomasz.golabek@nokia.com>2018-08-29 15:29:56 +0200
committergolabek <tomasz.golabek@nokia.com>2018-11-15 10:43:56 +0100
commit34f18a178b4b38632f435e776e15ce2f79d58094 (patch)
tree7bb78584134cbbe35f2db7f0f30ee0cd9ca7065b /vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java
parentf4766e0a53cb3e8408d56aaa113e6350024566b3 (diff)
Get subscribers rewritten to new rest client
Should be merged after: I561f8a5d95ec35fdddc648b24965dd9dac03c9a4 It contains cherry-picked changes from that review Change-Id: I22a9e9ce709ae4dd3abcf7a9cda6354a4f656b00 Issue-ID: VID-269 Signed-off-by: golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java
index 5b631a643..4e0e70e89 100644
--- a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java
@@ -33,11 +33,13 @@ import org.mockito.runners.MockitoJUnitRunner;
import org.onap.vid.aai.model.AaiNodeQueryResponse;
import org.onap.vid.aai.model.ResourceType;
import org.onap.vid.client.SyncRestClient;
+import org.onap.vid.model.SubscriberList;
@RunWith(MockitoJUnitRunner.class)
public class AaiOverTLSClientTest {
- public static final String SEARCH_NODES_QUERY_SEARCH_NODE_TYPE = "search/nodes-query?search-node-type=generic-vnf&filter=vnf-name:EQUALS:name";
+ private static final String SEARCH_NODES_QUERY_SEARCH_NODE_TYPE = "search/nodes-query?search-node-type=generic-vnf&filter=vnf-name:EQUALS:name";
+ private static final String SUBSCRIBERS = "business/customers?subscriber-type=INFRA&depth=0";
private AaiOverTLSClient aaiRestClient;
@Mock
@@ -51,7 +53,7 @@ public class AaiOverTLSClientTest {
}
@Test
- public void searchNodeTypeByName() {
+ public void testSearchNodeTypeByName() {
mockPropertyReader();
aaiRestClient.searchNodeTypeByName("name", ResourceType.GENERIC_VNF);
@@ -59,6 +61,15 @@ public class AaiOverTLSClientTest {
Matchers.eq(getHeaders()), Matchers.eq(Collections.emptyMap()), Matchers.eq(AaiNodeQueryResponse.class));
}
+ @Test
+ public void testGetAllSubscribers(){
+ mockPropertyReader();
+
+ aaiRestClient.getAllSubscribers();
+ Mockito.verify(syncRestClient).get(Matchers.contains(SUBSCRIBERS),
+ Matchers.eq(getHeaders()), Matchers.eq(Collections.emptyMap()), Matchers.eq(SubscriberList.class));
+ }
+
private void mockPropertyReader() {
Mockito.when(propertySupplier.getPassword()).thenReturn("Pass");
Mockito.when(propertySupplier.getUsername()).thenReturn("User");