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);
}
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());
}
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());
}
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";
}
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());
}
Aggregations