import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.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 {
- 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 SEARCH_NODES_QUERY_SEARCH_NODE_TYPE = "nodes/generic-vnfs?vnf-name=name";
private static final String SUBSCRIBERS = "business/customers?subscriber-type=INFRA&depth=0";
private AaiOverTLSClient aaiRestClient;
- @Mock
+ @Mock(answer = Answers.RETURNS_MOCKS)
private SyncRestClient syncRestClient;
@Mock
private AaiOverTLSPropertySupplier propertySupplier;
}
@Test
- public void testSearchNodeTypeByName() {
+ public void testIsNodeTypeExistsByName() {
mockPropertyReader();
- aaiRestClient.searchNodeTypeByName("name", ResourceType.GENERIC_VNF);
+ aaiRestClient.isNodeTypeExistsByName("name", ResourceType.GENERIC_VNF);
Mockito.verify(syncRestClient).get(contains(SEARCH_NODES_QUERY_SEARCH_NODE_TYPE),
- eq(getHeaders()), eq(Collections.emptyMap()), eq(AaiNodeQueryResponse.class));
+ eq(getHeaders()), eq(Collections.emptyMap()));
}
@Test