final JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
waitFor(10000, new Predicate() {
public boolean evaluate() throws Exception {
WorkflowJobGetJPAExecutor wfGetCmd = new WorkflowJobGetJPAExecutor(wfJobId);
WorkflowJobBean ret = jpaService.execute(wfGetCmd);
return (ret.getStatus() == WorkflowJob.Status.SUSPENDED);
}
});
WorkflowJobGetJPAExecutor wfGetCmd = new WorkflowJobGetJPAExecutor(wfJobId);
WorkflowJobBean ret = jpaService.execute(wfGetCmd);
assertEquals(WorkflowJob.Status.SUSPENDED, ret.getStatus());
}