Search in sources :

Example 6 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_default_recipe.

@Test
public void test_find_vf_module_recipe_default_recipe() throws MalformedURLException, NoRecipeException {
    VnfComponentsRecipe expected = new VnfComponentsRecipe();
    expected.setAction("createInstance");
    doReturn(null).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
    doReturn(expected).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("GR-API-DEFAULT", 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)

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