Search in sources :

Example 1 with WorkflowRestService

use of org.opencastproject.workflow.endpoint.WorkflowRestService in project opencast by opencast.

the class WorkflowRestEndpointTest method setUp.

@Before
public void setUp() throws Exception {
    // Create a workflow for the service to return
    workflow = new WorkflowInstanceImpl();
    workflow.setTitle("a workflow instance");
    workflow.setId(1);
    // Mock up the behavior of the workflow service
    WorkflowService service = EasyMock.createNiceMock(WorkflowService.class);
    EasyMock.expect(service.listAvailableWorkflowDefinitions()).andReturn(new ArrayList<WorkflowDefinition>());
    EasyMock.expect(service.getWorkflowById(EasyMock.anyLong())).andThrow(new NotFoundException()).times(2).andReturn(workflow);
    EasyMock.replay(service);
    // Set up the rest endpoint
    restService = new WorkflowRestService();
    restService.setService(service);
    restService.activate(null);
}
Also used : WorkflowRestService(org.opencastproject.workflow.endpoint.WorkflowRestService) WorkflowInstanceImpl(org.opencastproject.workflow.api.WorkflowInstanceImpl) WorkflowService(org.opencastproject.workflow.api.WorkflowService) WorkflowDefinition(org.opencastproject.workflow.api.WorkflowDefinition) NotFoundException(org.opencastproject.util.NotFoundException) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 NotFoundException (org.opencastproject.util.NotFoundException)1 WorkflowDefinition (org.opencastproject.workflow.api.WorkflowDefinition)1 WorkflowInstanceImpl (org.opencastproject.workflow.api.WorkflowInstanceImpl)1 WorkflowService (org.opencastproject.workflow.api.WorkflowService)1 WorkflowRestService (org.opencastproject.workflow.endpoint.WorkflowRestService)1