Search in sources :

Example 1 with VnfComponentsRecipe

use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.

the class VfModuleRestHandlerTest method test_find_vf_module_recipe_not_found.

@Test
public void test_find_vf_module_recipe_not_found() throws MalformedURLException, NoRecipeException {
    VnfComponentsRecipe expected = new VnfComponentsRecipe();
    expected.setAction("createInstance");
    exceptionRule.expect(NoRecipeException.class);
    exceptionRule.expectMessage("Unable to locate custom or default recipe for ModelType: vfModule , Action: createInstance, CustomizationId: testModelId");
    restHandler.findVfModuleRecipe("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
}
Also used : VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) Test(org.junit.Test)

Example 2 with VnfComponentsRecipe

use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.

the class VfModuleRestHandlerTest method test_find_vf_module_recipe.

@Test
public void test_find_vf_module_recipe() throws MalformedURLException, NoRecipeException {
    VnfComponentsRecipe expected = new VnfComponentsRecipe();
    expected.setAction("createInstance");
    doReturn(expected).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
    Recipe actual = restHandler.findVfModuleRecipe("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
    assertThat(actual, sameBeanAs(expected));
    Mockito.verify(catalogDbClient, Mockito.times(1)).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
}
Also used : Recipe(org.onap.so.db.catalog.beans.Recipe) VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) Test(org.junit.Test)

Example 3 with VnfComponentsRecipe

use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.

the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound.

@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound() {
    VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(UUID.randomUUID().toString(), "volumeGroup", "createInstance");
    assertNull(vnfComponentsRecipe);
}
Also used : VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 4 with VnfComponentsRecipe

use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.

the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction.

@Test
public void testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction() {
    VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
    assertNotNull(vnfComponentsRecipe);
    assertNotNull(vnfComponentsRecipe.getAction());
    assertNotNull(vnfComponentsRecipe.getVnfComponentType());
    assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
    assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
}
Also used : VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Example 5 with VnfComponentsRecipe

use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.

the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction.

@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction() {
    VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
    assertNotNull(vnfComponentsRecipe);
    assertNotNull(vnfComponentsRecipe.getAction());
    assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
    assertNotNull(vnfComponentsRecipe.getVnfComponentType());
    assertEquals("Gr api recipe to create volume-group", vnfComponentsRecipe.getDescription());
    assertEquals("/mso/async/services/WorkflowActionBB", vnfComponentsRecipe.getOrchestrationUri());
}
Also used : VnfComponentsRecipe(org.onap.so.db.catalog.beans.VnfComponentsRecipe) Test(org.junit.Test) CatalogDbAdapterBaseTest(org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)

Aggregations

Test (org.junit.Test)6 VnfComponentsRecipe (org.onap.so.db.catalog.beans.VnfComponentsRecipe)6 CatalogDbAdapterBaseTest (org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)3 Recipe (org.onap.so.db.catalog.beans.Recipe)2