Search in sources :

Example 1 with ServiceNotFoundException

use of com.emc.sa.engine.service.ServiceNotFoundException in project coprhd-controller by CoprHD.

the class ExecutionEngineImplTest method testErrorCreatingService.

@Test
public void testErrorCreatingService() {
    ExecutionEngineImpl engine = new ExecutionEngineImpl();
    engine.setModelClient(modelClient);
    engine.setServiceFactory(new ExecutionServiceFactory() {

        @Override
        public ExecutionService createService(Order order, CatalogService catalogService) throws ServiceNotFoundException {
            throw new RuntimeException("Unexpected error");
        }
    });
    Order order = executeOrder(engine, createOrder("ErrorCreatingService"));
    Assert.assertEquals(OrderStatus.ERROR.name(), order.getOrderStatus());
}
Also used : Order(com.emc.storageos.db.client.model.uimodels.Order) ExecutionServiceFactory(com.emc.sa.engine.service.ExecutionServiceFactory) ServiceNotFoundException(com.emc.sa.engine.service.ServiceNotFoundException) CatalogService(com.emc.storageos.db.client.model.uimodels.CatalogService) ExecutionService(com.emc.sa.engine.service.ExecutionService) AbstractExecutionService(com.emc.sa.engine.service.AbstractExecutionService) Test(org.junit.Test)

Aggregations

AbstractExecutionService (com.emc.sa.engine.service.AbstractExecutionService)1 ExecutionService (com.emc.sa.engine.service.ExecutionService)1 ExecutionServiceFactory (com.emc.sa.engine.service.ExecutionServiceFactory)1 ServiceNotFoundException (com.emc.sa.engine.service.ServiceNotFoundException)1 CatalogService (com.emc.storageos.db.client.model.uimodels.CatalogService)1 Order (com.emc.storageos.db.client.model.uimodels.Order)1 Test (org.junit.Test)1