Search in sources :

Example 36 with ServiceRecipe

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

the class ServiceInstanceRestHandlerTest method test_find_service_recipe_not_found.

@Test
public void test_find_service_recipe_not_found() throws MalformedURLException, NoRecipeException {
    ServiceRecipe expected = new ServiceRecipe();
    expected.setAction("createInstance");
    doReturn(null).when(catalogDbClient).findServiceRecipeByActionAndServiceModelUUID(Action.createInstance.toString(), "testModelId");
    doReturn(null).when(catalogDbClient).findServiceRecipeByActionAndServiceModelUUID(Action.createInstance.toString(), "d88da85c-d9e8-4f73-b837-3a72a431622b");
    exceptionRule.expect(NoRecipeException.class);
    exceptionRule.expectMessage("Unable to locate custom or default recipe for, Action: createInstance, Model UUID: testModelId");
    restHandler.findServiceRecipe("testModelId", Action.createInstance.toString());
}
Also used : ServiceRecipe(org.onap.so.db.catalog.beans.ServiceRecipe) Test(org.junit.Test)

Aggregations

ServiceRecipe (org.onap.so.db.catalog.beans.ServiceRecipe)36 Test (org.junit.Test)27 Service (org.onap.so.db.catalog.beans.Service)24 RequestReferences (org.onap.so.serviceinstancebeans.RequestReferences)10 ServiceInstancesResponse (org.onap.so.serviceinstancebeans.ServiceInstancesResponse)10 CatalogDbAdapterBaseTest (org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest)5 RequestError (org.onap.so.serviceinstancebeans.RequestError)5 Before (org.junit.Before)3 Recipe (org.onap.so.db.catalog.beans.Recipe)3 HttpEntity (org.springframework.http.HttpEntity)2 EntityNotFoundException (javax.persistence.EntityNotFoundException)1 ActivateOrDeactivate3gppService (org.onap.so.apihandlerinfra.onap3gppserviceinstancebeans.ActivateOrDeactivate3gppService)1 Allocate3gppService (org.onap.so.apihandlerinfra.onap3gppserviceinstancebeans.Allocate3gppService)1 DeAllocate3gppService (org.onap.so.apihandlerinfra.onap3gppserviceinstancebeans.DeAllocate3gppService)1 Modify3gppService (org.onap.so.apihandlerinfra.onap3gppserviceinstancebeans.Modify3gppService)1 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)1 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)1 RequestParameters (org.onap.so.serviceinstancebeans.RequestParameters)1 Service (org.onap.so.serviceinstancebeans.Service)1 HttpHeaders (org.springframework.http.HttpHeaders)1