Search in sources :

Example 11 with SubjectsOptionsInterface

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;
}
Also used : SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface)

Example 12 with SubjectsOptionsInterface

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);
}
Also used : SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Aggregations

SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)12 SubjectModelInterface (easytests.core.models.SubjectModelInterface)11 SubjectEntity (easytests.core.entities.SubjectEntity)3 ArrayList (java.util.ArrayList)3 SubjectsOptions (easytests.core.options.SubjectsOptions)2 TopicModelInterface (easytests.core.models.TopicModelInterface)1 UserModelInterface (easytests.core.models.UserModelInterface)1 IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)1 UsersOptions (easytests.core.options.UsersOptions)1 UsersOptionsInterface (easytests.core.options.UsersOptionsInterface)1 SubjectDto (easytests.personal.dto.SubjectDto)1 Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1