Search in sources :

Example 1 with SubjectsOptions

use of easytests.core.options.SubjectsOptions in project easy-tests by malinink.

the class IssueStandardsServiceTest method testFindWithOptions.

@Test
public void testFindWithOptions() throws Exception {
    final Integer id = 1;
    final Integer subjectId = 1;
    final IssueStandardModelInterface issueStandardModel = Models.createIssueStandardModel(id, 300, 30, subjectId);
    final SubjectModelInterface subjectModel = Models.createSubjectModel(subjectId, "test1", "testdescription1", 2);
    issueStandardModel.setSubject(subjectModel);
    final IssueStandardModelInterface foundedIssueStandardModel = this.issueStandardsService.find(id, new IssueStandardsOptions().withSubject(new SubjectsOptions()));
    Assert.assertEquals(issueStandardModel, foundedIssueStandardModel);
    Assert.assertEquals(subjectModel, foundedIssueStandardModel.getSubject());
}
Also used : IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) SubjectsOptions(easytests.core.options.SubjectsOptions) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) SubjectModelInterface(easytests.core.models.SubjectModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with SubjectsOptions

use of easytests.core.options.SubjectsOptions in project easy-tests by malinink.

the class SubjectsController method read.

@GetMapping("{id}")
public String read(@PathVariable("id") Integer id, Model model) {
    final SubjectsOptionsInterface subjectsOptions = new SubjectsOptions().withIssueStandard(new IssueStandardsOptions());
    final SubjectModelInterface subjectModel = getSubjectModel(id, subjectsOptions);
    final SubjectDto subject = new SubjectDto();
    subject.map(subjectModel);
    model.addAttribute("subject", subject);
    model.addAttribute("issueStandardId", subjectModel.getIssueStandard().getId());
    return "subjects/view";
}
Also used : SubjectDto(easytests.personal.dto.SubjectDto) SubjectsOptions(easytests.core.options.SubjectsOptions) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 3 with SubjectsOptions

use of easytests.core.options.SubjectsOptions in project easy-tests by malinink.

the class UsersOptionsBuilderTest method testForDelete.

@Test
public void testForDelete() throws Exception {
    final SubjectsOptionsInterface subjectsOptions = new SubjectsOptions();
    given(this.subjectsOptionsBuilder.forDelete()).willReturn(subjectsOptions);
    final UsersOptionsInterface usersOptions = this.usersOptionsBuilder.forDelete();
    Assert.assertEquals(new UsersOptions().withSubjects(subjectsOptions), usersOptions);
}
Also used : SubjectsOptions(easytests.core.options.SubjectsOptions) UsersOptions(easytests.core.options.UsersOptions) UsersOptionsInterface(easytests.core.options.UsersOptionsInterface) SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

SubjectsOptions (easytests.core.options.SubjectsOptions)3 SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)2 SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)2 Test (org.junit.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)1 UsersOptions (easytests.core.options.UsersOptions)1 UsersOptionsInterface (easytests.core.options.UsersOptionsInterface)1 SubjectDto (easytests.personal.dto.SubjectDto)1