use of org.ligoj.app.resource.subscription.TaskSampleSubscriptionResource in project ligoj-api by ligoj.
the class LongTaskRunnerTest method startTaskRunningRemote.
/**
* Task is locally finished, but not from the external system view.
*/
@Test
public void startTaskRunningRemote() {
resource = new TaskSampleSubscriptionResource() {
@Override
public boolean isFinished(final TaskSampleSubscription task) {
// Never remotely finished
return false;
}
};
applicationContext.getAutowireCapableBeanFactory().autowireBean(resource);
final TaskSampleSubscription newTaskSample = newTaskSample();
repository.saveAndFlush(newTaskSample);
Assertions.assertThrows(BusinessException.class, () -> {
resource.startTask(subscription, task -> task.setData("init"));
});
}
Aggregations