use of easytests.core.options.SubjectsOptionsInterface in project easy-tests by malinink.
the class TopicsController method getCurrentSubjectModel.
private SubjectModelInterface getCurrentSubjectModel(Integer subjectId, boolean withTopics) {
final SubjectsOptionsInterface subjectsOptions = this.subjectsOptionsBuilder.forAuth();
final SubjectModelInterface subjectModel = subjectsService.find(subjectId, subjectsOptions);
if (withTopics) {
final List<TopicModelInterface> topics = this.topicsService.findBySubject(subjectModel);
subjectModel.setTopics(topics);
}
checkModel(subjectModel);
return subjectModel;
}
use of easytests.core.options.SubjectsOptionsInterface in project easy-tests by malinink.
the class SubjectsServiceTest method testDeleteWithOptions.
@Test
public void testDeleteWithOptions() throws Exception {
final SubjectModelInterface subjectModel = this.createSubjectModel(null, "test", "description", 1, 1);
final SubjectsOptionsInterface subjectsOptions = Mockito.mock(SubjectsOptionsInterface.class);
this.subjectsService.delete(subjectModel, subjectsOptions);
verify(subjectsOptions).deleteWithRelations(subjectModel);
}
Aggregations