use of easytests.core.models.TopicModel in project easy-tests by malinink.
the class TopicsService method map.
private TopicModelInterface map(TopicEntity topicEntity) {
if (topicEntity == null) {
return null;
}
final TopicModelInterface topicModel = new TopicModel();
topicModel.map(topicEntity);
return topicModel;
}
use of easytests.core.models.TopicModel in project easy-tests by malinink.
the class TopicsController method create.
@PostMapping("create/")
public String create(Model model, @Valid @NotNull TopicDto topic, BindingResult bindingResult, @PathVariable("subjectId") Integer subjectId) {
final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
if (bindingResult.hasErrors()) {
setCreateBehaviour(model);
model.addAttribute("topic", topic);
model.addAttribute("subjectId", subjectId);
model.addAttribute("errors", bindingResult);
return "topics/form";
}
final TopicModelInterface topicModel = new TopicModel();
topic.mapInto(topicModel);
topicModel.setSubject(subjectModel);
this.topicsService.save(topicModel);
return "redirect:/personal/subjects/" + subjectId + "/topics/";
}
use of easytests.core.models.TopicModel in project easy-tests by malinink.
the class TopicsServiceTest method mapTopicModel.
private TopicModelInterface mapTopicModel(TopicEntity topicEntity) {
final TopicModelInterface topicModel = new TopicModel();
topicModel.map(topicEntity);
return topicModel;
}
Aggregations