Search in sources :

Example 21 with AAIPluralResourceUri

use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.

the class AAINetworkResourcesTest method checkInstanceGroupNameInUseTrueTest.

@Test
public void checkInstanceGroupNameInUseTrueTest() throws Exception {
    AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Networks()).queryParam("network-name", "networkName");
    doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
    boolean nameInUse = aaiNetworkResources.checkNetworkNameInUse("networkName");
    assertTrue(nameInUse);
}
Also used : AAIPluralResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri) Test(org.junit.Test)

Example 22 with AAIPluralResourceUri

use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.

the class AAIServiceInstanceResourcesTest method checkInstanceServiceNameInUseFalseTest.

@Test
public void checkInstanceServiceNameInUseFalseTest() throws Exception {
    AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment()).queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
    doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
    boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance);
    assertFalse(nameInUse);
}
Also used : AAIPluralResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri) Test(org.junit.Test)

Example 23 with AAIPluralResourceUri

use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.

the class AAIVfModuleResourcesTest method checkNameInUseTrueTest.

@Test
public void checkNameInUseTrueTest() throws Exception {
    AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
    AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
    doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
    doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
    boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
    assertTrue(nameInUse);
}
Also used : AAIPluralResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri) Test(org.junit.Test)

Example 24 with AAIPluralResourceUri

use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.

the class AAIVfModuleResourcesTest method checkNameInUseFalseTest.

@Test
public void checkNameInUseFalseTest() throws Exception {
    AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
    AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
    doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
    doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
    boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
    assertFalse(nameInUse);
}
Also used : AAIPluralResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri) Test(org.junit.Test)

Example 25 with AAIPluralResourceUri

use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.

the class AAIVfModuleResourcesTest method checkNameInUseFalseIsResumeTest.

@Test
public void checkNameInUseFalseIsResumeTest() throws Exception {
    AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
    AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
    doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
    boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
    assertFalse(nameInUse);
}
Also used : AAIPluralResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri) Test(org.junit.Test)

Aggregations

AAIPluralResourceUri (org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri)44 Test (org.junit.Test)29 GenericVnf (org.onap.aai.domain.yang.GenericVnf)7 GenericVnfs (org.onap.aai.domain.yang.GenericVnfs)6 RestClient (org.onap.so.client.RestClient)6 AAIResourcesClient (org.onap.aaiclient.client.aai.AAIResourcesClient)5 ArrayList (java.util.ArrayList)3 VfModule (org.onap.aai.domain.yang.VfModule)3 VfModules (org.onap.aai.domain.yang.VfModules)3 VolumeGroup (org.onap.aai.domain.yang.VolumeGroup)3 VolumeGroups (org.onap.aai.domain.yang.VolumeGroups)3 AAIResultWrapper (org.onap.aaiclient.client.aai.entities.AAIResultWrapper)3 AAIResourceUri (org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri)3 ServiceInstance (org.onap.aai.domain.yang.ServiceInstance)2 ServiceInstances (org.onap.aai.domain.yang.ServiceInstances)2 Relationships (org.onap.aaiclient.client.aai.entities.Relationships)2 MultipleObjectsFoundException (org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1