Search in sources :

Example 1 with IssueStandardsOptions

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

the class IssueStandardQuestionTypeOptionsOptionsBuilderTest method testForAuth.

@Test
public void testForAuth() throws Exception {
    final IssueStandardsOptionsInterface issueStandardsOptions = new IssueStandardsOptions();
    given(this.issueStandardsOptionsBuilder.forAuth()).willReturn(issueStandardsOptions);
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = this.questionTypeOptionsOptionsBuilder.forAuth();
    Assert.assertEquals(new IssueStandardQuestionTypeOptionsOptions().withIssueStandard(issueStandardsOptions), questionTypeOptionsOptions);
}
Also used : IssueStandardQuestionTypeOptionsOptions(easytests.core.options.IssueStandardQuestionTypeOptionsOptions) IssueStandardsOptionsInterface(easytests.core.options.IssueStandardsOptionsInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Example 2 with IssueStandardsOptions

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

the class IssueStandardQuestionTypeOptionsServiceTest method testFindWithOptions.

@Test
public void testFindWithOptions() throws Exception {
    final Integer id = 1;
    final Integer issueStandardId = 1;
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 1, null, null, issueStandardId);
    final IssueStandardModelInterface issueStandardModel = Models.createIssueStandardModel(issueStandardId, 300, 30, 1);
    questionTypeOptionModel.setIssueStandard(issueStandardModel);
    final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id, new IssueStandardQuestionTypeOptionsOptions().withIssueStandard(new IssueStandardsOptions()));
    Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
    Assert.assertEquals(issueStandardModel, foundedQuestionTypeOptionModel.getIssueStandard());
}
Also used : IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) IssueStandardQuestionTypeOptionsOptions(easytests.core.options.IssueStandardQuestionTypeOptionsOptions) IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with IssueStandardsOptions

use of easytests.core.options.IssueStandardsOptions 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 4 with IssueStandardsOptions

use of easytests.core.options.IssueStandardsOptions 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 5 with IssueStandardsOptions

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

the class IssueStandardTopicPrioritiesServiceTest method testFindWithOptions.

@Test
public void testFindWithOptions() throws Exception {
    final Integer id = 1;
    final Integer issueStandardId = 1;
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = Models.createTopicPriorityModel(id, 1, true, issueStandardId);
    final IssueStandardModelInterface issueStandardModel = Models.createIssueStandardModel(issueStandardId, 300, 30, 1);
    topicPriorityModel.setIssueStandard(issueStandardModel);
    final IssueStandardTopicPriorityModelInterface foundedTopicPriorityModel = this.topicPrioritiesService.find(id, new IssueStandardTopicPrioritiesOptions().withIssueStandard(new IssueStandardsOptions()));
    Assert.assertEquals(topicPriorityModel, foundedTopicPriorityModel);
    Assert.assertEquals(issueStandardModel, foundedTopicPriorityModel.getIssueStandard());
}
Also used : IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) IssueStandardTopicPrioritiesOptions(easytests.core.options.IssueStandardTopicPrioritiesOptions) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)6 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)3 SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 IssueStandardQuestionTypeOptionsOptions (easytests.core.options.IssueStandardQuestionTypeOptionsOptions)2 IssueStandardTopicPrioritiesOptions (easytests.core.options.IssueStandardTopicPrioritiesOptions)2 IssueStandardsOptionsInterface (easytests.core.options.IssueStandardsOptionsInterface)2 SubjectsOptions (easytests.core.options.SubjectsOptions)2 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)1 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)1 IssueStandardQuestionTypeOptionsOptionsInterface (easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)1 IssueStandardTopicPrioritiesOptionsInterface (easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface)1 SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)1 SubjectDto (easytests.personal.dto.SubjectDto)1