Search in sources :

Example 16 with SubjectModelInterface

use of easytests.core.models.SubjectModelInterface in project easy-tests by malinink.

the class TopicsController method list.

@GetMapping("")
public String list(Model model, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, true);
    final List<TopicModelInterface> topics = subjectModel.getTopics();
    model.addAttribute("topics", topics);
    model.addAttribute("subjectId", subjectId);
    return "topics/list";
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 17 with SubjectModelInterface

use of easytests.core.models.SubjectModelInterface in project easy-tests by malinink.

the class TopicsController method deleteConfirmation.

@GetMapping("delete/{topicId}")
public String deleteConfirmation(Model model, @PathVariable("topicId") Integer topicId, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicModelInterface topicModel = this.getTopicModel(topicId, subjectId);
    model.addAttribute("subjectId", subjectId);
    return "topics/delete";
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 18 with SubjectModelInterface

use of easytests.core.models.SubjectModelInterface 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 19 with SubjectModelInterface

use of easytests.core.models.SubjectModelInterface in project easy-tests by malinink.

the class SubjectsController method getSubjectModel.

private SubjectModelInterface getSubjectModel(Integer id) {
    final SubjectModelInterface subjectModel = this.subjectsService.find(id);
    checkModel(subjectModel);
    return subjectModel;
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 20 with SubjectModelInterface

use of easytests.core.models.SubjectModelInterface in project easy-tests by malinink.

the class SubjectsController method getSubjectModel.

private SubjectModelInterface getSubjectModel(Integer id, SubjectsOptionsInterface subjectsOptions) {
    final SubjectModelInterface subjectModel = this.subjectsService.find(id, subjectsOptions);
    checkModel(subjectModel);
    return subjectModel;
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Aggregations

SubjectModelInterface (easytests.core.models.SubjectModelInterface)64 Test (org.junit.Test)22 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)21 TopicModelInterface (easytests.core.models.TopicModelInterface)18 ArrayList (java.util.ArrayList)16 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)15 SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)11 UserModelInterface (easytests.core.models.UserModelInterface)9 SubjectEntity (easytests.core.entities.SubjectEntity)7 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)7 SubjectModel (easytests.core.models.SubjectModel)6 InOrder (org.mockito.InOrder)6 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)5 TopicsServiceInterface (easytests.core.services.TopicsServiceInterface)5 GetMapping (org.springframework.web.bind.annotation.GetMapping)5 TopicEntity (easytests.core.entities.TopicEntity)4 IssueModelInterface (easytests.core.models.IssueModelInterface)4 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)4 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)4 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)4