use of easytests.core.models.SubjectModel in project easy-tests by malinink.
the class SubjectsController method create.
@PostMapping("create")
public String create(@Valid @NotNull SubjectDto subject, BindingResult bindingResult, Model model) {
if (bindingResult.hasErrors()) {
model.addAttribute("methodType", "create");
model.addAttribute("subject", subject);
model.addAttribute("errors", bindingResult);
return "subjects/form";
}
final SubjectModelInterface subjectModel = new SubjectModel();
subject.mapInto(subjectModel);
subjectModel.setUser(this.getCurrentUserModel());
subjectsService.save(subjectModel);
final IssueStandardModelInterface issueStandardModel = new IssueStandardModel();
issueStandardModel.setSubject(new SubjectModelEmpty(subjectModel.getId()));
issueStandardsService.save(issueStandardModel);
return "redirect:/personal/subjects/list";
}
use of easytests.core.models.SubjectModel in project easy-tests by malinink.
the class SubjectsServiceTest method mapSubjectModel.
private SubjectModelInterface mapSubjectModel(SubjectEntity subjectEntity) {
final SubjectModelInterface subjectModel = new SubjectModel();
subjectModel.map(subjectEntity);
return subjectModel;
}
Aggregations