Skip to content
Snippets Groups Projects

M2 course tests

Merged Ester Vilímková requested to merge M2-course-tests into M2
2 files
+ 18
18
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -17,11 +17,11 @@ public class LectureDto extends DomainObjectDto {
@Future(message = "Lecture start date and time must be in the future")
@NotNull(message = "Lecture start date and time cannot be null")
private LocalDateTime from;
private LocalDateTime lectureFrom;
@Future(message = "Lecture end date and time must be in the future")
@NotNull(message = "Lecture end date and time cannot be null")
private LocalDateTime to;
private LocalDateTime lectureTo;
@NotBlank(message = "Lecture topic cannot be blank")
@Size(max = 255, message = "Lecture topic must be no more than {max} characters")
@@ -41,8 +41,8 @@ public class LectureDto extends DomainObjectDto {
private List<Long> studentIds;
public LectureDto(LocalDateTime from, LocalDateTime to, String topic, Integer capacity, Long lecturerId, Long courseId) {
this.from = from;
this.to = to;
this.lectureFrom = from;
this.lectureTo = to;
this.topic = topic;
this.capacity = capacity;
this.lecturerId = lecturerId;
@@ -52,7 +52,7 @@ public class LectureDto extends DomainObjectDto {
@AssertTrue(message = "Lecture start datetime must be before Lecture end datetime")
private boolean isFromDateBeforeToDate() {
if (from == null || to == null) return true;
return from.isBefore(to);
if (lectureFrom == null || lectureTo == null) return true;
return lectureFrom.isBefore(lectureTo);
}
}
Loading