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);
}
Aggregations