.runOnTransaction(new IOnTransaction<Resource>() {
@Override
public Resource execute() {
Worker result = givenValidWorker();
CriterionType type = createCriterionType("testType");
Criterion parent = createCriterion("parent", type);
parentCriteron[0] = parent;
Criterion child = createCriterion("child", type);
child.setParent(parent);
addSatisfactionsOn(result,
Interval.from(new LocalDate(1970, 1, 1)), child);
return result;
}
});
final Criterion parent = transactionService
.runOnReadOnlyTransaction(new IOnTransaction<Criterion>() {
@Override
public Criterion execute() {
return criterionDAO