commit 0b244cd2eb7dac1eddc18c678f5286dce4eacd2c
Author: D0miq <dpoch@email.com>
Date:   Thu Jun 6 00:12:12 2019 +0200

    Final version of the class VacationDay with its tests

diff --git a/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java b/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
index 32f357c..a079dc4 100644
--- a/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
+++ b/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
@@ -23,7 +23,7 @@ public class VacationDay {
     /**
      * The ID of this vacation.
      */
-    private final long id;
+    private Long id;
 
     /**
      * The date of this vacation.
@@ -43,7 +43,7 @@ public class VacationDay {
     /**
      * The date and time of a creation of this vacation.
      */
-    private final LocalDateTime creationDate;
+    private LocalDateTime creationDate;
 
     /**
      * The approval status of this vacation.
@@ -56,84 +56,23 @@ public class VacationDay {
     private VacationType type;
 
     /**
-     * Creates an empty vacation for testing purposes only.
-     * It just sets id to zero and creation date to nowte.
-     */
-    public VacationDay() {
-        VacationDay.log.trace("Creating a new instance of the class VacationDay.");
-        this.id = 0;
-        this.creationDate = LocalDateTime.now();
-    }
-
-    /**
-     * Creates a new sick day with the specified id, date, date when a sick day request was created and its approval status.
-     *
-     * @param id           the ID of the sick day
-     * @param date         the date of the sick day
-     * @param creationDate the date and time of the creation of the sick day
-     * @param status       the approval status of the sick day
-     */
-    public VacationDay(final long id, final LocalDate date, final LocalDateTime creationDate, final Status status) {
-        this(id, date, null, null, creationDate, status, VacationType.SICK_DAY);
-    }
-
-    /**
-     * Creates a new overtime with the specified id, date, starting time, ending time, date when an overtime request was created and its approval status.
-     *
-     * @param id           the ID of the overtime
-     * @param date         the date of the overtime
-     * @param from         the starting time of the overtime
-     * @param to           the ending time of the overtime
-     * @param creationDate the date and time of the creation of the overtime
-     * @param status       the approval status of the overtime
-     */
-    public VacationDay(final long id, final LocalDate date, final LocalTime from, final LocalTime to, final LocalDateTime creationDate, final Status status) {
-        this(id, date, from, to, creationDate, status, VacationType.VACATION);
-    }
-
-    /**
-     * Creates a new overtime or sick day with attributes known during insertion.
+     * Returns the ID of this vacation.
      *
-     * @param date         the date of a vacation
-     * @param from         the starting time of a vacation
-     * @param to           the ending time of a vacation
-     * @param status       the approval status of a vacation
-     * @param type         the type of a vacation
+     * @return the ID of this vacation
      */
-    public VacationDay(final LocalDate date, final LocalTime from, final LocalTime to, final Status status, final VacationType type) {
-        this(0, date, from, to, null, status, type);
+    public long getId() {
+        return this.id;
     }
 
     /**
-     * Creates a new overtime or sick day with all attributes.
+     * Replaces the ID of this vacation with the given one.
      *
-     * @param id           the ID of a vacation
-     * @param date         the date of a vacation
-     * @param from         the starting time of a vacation
-     * @param to           the ending time of a vacation
-     * @param creationDate the date and time of a creation of a vacation
-     * @param status       the approval status of a vacation
-     * @param type         the type of a vacation
+     * @param id the given ID
      */
-    public VacationDay(final long id, final LocalDate date, final LocalTime from, final LocalTime to, final LocalDateTime creationDate, final Status status, final VacationType type) {
-        VacationDay.log.trace("Creating a new instance of the class VacationDay.");
-        VacationDay.log.debug("VacationDay: id={}, date={}, from={}, to={}, creationDate={}, status={}, type={}", id, date, from, to, creationDate, status, type);
+    public void setId(final Long id) {
+        VacationDay.log.debug("Setting a new id: {}", id);
 
         this.id = id;
-        this.setDate(date);
-        this.setType(type);
-        this.setTime(from, to);
-        this.creationDate = creationDate;
-        this.setStatus(status);
-    }
-
-    /**
-     * Returns the ID of this vacation.
-     *
-     * @return the ID of this vacation
-     */
-    public long getId() {
-        return this.id;
     }
 
     /**
@@ -264,6 +203,17 @@ public class VacationDay {
         return this.creationDate;
     }
 
+    /**
+     * Replaces the creation date of this vacation with the given date and time.
+     *
+     * @param creationDate the new creation date
+     */
+    public void setCreationDate(final LocalDateTime creationDate) {
+        VacationDay.log.debug("Setting a new creation date of this vacation: {}", creationDate);
+
+        this.creationDate = creationDate;
+    }
+
     /**
      * Returns the approval status of this vacation.
      *
@@ -332,8 +282,8 @@ public class VacationDay {
         return "VacationDay{" +
                 "id=" + this.id +
                 ", date=" + this.date +
-                ", from=" + String.valueOf(this.from) +
-                ", to=" + String.valueOf(this.to) +
+                ", from=" + this.from +
+                ", to=" + this.to +
                 ", creationDate=" + this.creationDate +
                 ", status=" + this.status +
                 ", type=" + this.type +
diff --git a/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java b/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java
index 5fc2d8e..9263379 100644
--- a/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java
+++ b/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java
@@ -1,6 +1,7 @@
 package cz.zcu.yamanager.domain;
 
 import cz.zcu.yamanager.dto.Status;
+import cz.zcu.yamanager.dto.VacationType;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -28,11 +29,299 @@ class VacationDayTest {
         this.vacationDay = new VacationDay();
     }
 
+    /**
+     * Tests the method {@code setDate} with common values where no problem should occur.
+     */
+    @Test
+    void setDate_valid() {
+        LocalDate date = LocalDate.of(2000,10,12);
+        this.vacationDay.setDate(date);
+        assertEquals(date, this.vacationDay.getDate());
+    }
+
+    /**
+     * Tests the method {@code setDate} with null input value.
+     */
+    @Test
+    void setDate_nullInput() {
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setDate(null));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with a null input, null ending time and null vacation type.
+     */
+    @Test
+    void setFrom_nullFrom_nullTo_nullType_valid() {
+        this.vacationDay.setFrom(null);
+        assertNull(this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with a null input, ending time and null vacation type.
+     */
+    @Test
+    void setFrom_nullFrom_to_nullType_valid() {
+        this.vacationDay.setTo(LocalTime.of(20, 0));
+        this.vacationDay.setFrom(null);
+        assertNull(this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with an input, null ending time and null vacation type.
+     */
+    @Test
+    void setFrom_from_nullTo_nullType_valid() {
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with an input, ending time and null vacation type.
+     */
+    @Test
+    void setFrom_from_to_nullType_valid() {
+        LocalTime to = LocalTime.of(20, 0);
+        this.vacationDay.setTo(to);
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with same input and ending time and null vacation type.
+     */
+    @Test
+    void setFrom_from_to_nullType_same() {
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(to));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with same input and ending time and null vacation type.
+     */
+    @Test
+    void setFrom_from_to_nullType_wrongOrder() {
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(LocalTime.of(20,0)));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with a null input, null ending time and sick day vacation type.
+     */
+    @Test
+    void setFrom_nullFrom_nullTo_sickDay_valid() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        this.vacationDay.setFrom(null);
+        assertNull(this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with an input and sick day vacation type.
+     */
+    @Test
+    void setFrom_from_sickDay() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(LocalTime.of(20,0)));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with a null input, null ending time and vacation vacation type.
+     */
+    @Test
+    void setFrom_nullFrom_vacation_valid() {
+        this.vacationDay.setFrom(null);
+        assertNull(this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with an input, null ending time and vacation vacation type.
+     */
+    @Test
+    void setFrom_from_nullTo_vacation_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with an input, ending time and vacation vacation type.
+     */
+    @Test
+    void setFrom_from_to_vacation_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime to = LocalTime.of(20, 0);
+        this.vacationDay.setTo(to);
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with same input and ending time and vacation vacation type.
+     */
+    @Test
+    void setFrom_from_to_vacation_same() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(LocalTime.of(10,0)));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with same input and ending time and vacation vacation type.
+     */
+    @Test
+    void setFrom_from_to_vacation_wrongOrder() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(LocalTime.of(20,0)));
+    }
+
+    /**
+     * Tests the method {@code setTo} with a null input, null starting time and null vacation type.
+     */
+    @Test
+    void setTo_nullTo_nullFrom_nullType_valid() {
+        this.vacationDay.setTo(null);
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with a null input, starting time and null vacation type.
+     */
+    @Test
+    void setTo_nullTo_from_nullType_valid() {
+        this.vacationDay.setFrom(LocalTime.of(20, 0));
+        this.vacationDay.setTo(null);
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with an input, null starting time and null vacation type.
+     */
+    @Test
+    void setTo_to_nullFrom_nullType_valid() {
+        LocalTime to = LocalTime.of(10,0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with an input, starting time and null vacation type.
+     */
+    @Test
+    void setTo_to_from_nullType_valid() {
+        LocalTime from = LocalTime.of(10, 0);
+        this.vacationDay.setFrom(from);
+        LocalTime to = LocalTime.of(20,0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with same input and starting time and null vacation type.
+     */
+    @Test
+    void setTo_to_from_nullType_same() {
+        LocalTime from = LocalTime.of(10, 0);
+        this.vacationDay.setFrom(from);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(LocalTime.of(10,0)));
+    }
+
+    /**
+     * Tests the method {@code setTo} with same input and starting time and null vacation type.
+     */
+    @Test
+    void setTo_to_from_nullType_wrongOrder() {
+        LocalTime from = LocalTime.of(20, 0);
+        this.vacationDay.setFrom(from);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(LocalTime.of(10,0)));
+    }
+
+    /**
+     * Tests the method {@code setTo} with a null input, null starting time and sick day vacation type.
+     */
+    @Test
+    void setTo_nullTo_nullFrom_sickDay_valid() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        this.vacationDay.setTo(null);
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with an input and sick day vacation type.
+     */
+    @Test
+    void setTo_to_sickDay() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(LocalTime.of(20,0)));
+    }
+
+    /**
+     * Tests the method {@code setTo} with a null input, null starting time and vacation vacation type.
+     */
+    @Test
+    void setTo_nullTo_vacation_valid() {
+        this.vacationDay.setTo(null);
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with an input, null starting time and vacation vacation type.
+     */
+    @Test
+    void setTo_to_nullFrom_vacation_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime to = LocalTime.of(10,0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with an input, starting time and vacation vacation type.
+     */
+    @Test
+    void setTo_to_from_vacation_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime from = LocalTime.of(10, 0);
+        this.vacationDay.setFrom(from);
+        LocalTime to = LocalTime.of(20,0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with same input and starting time and vacation vacation type.
+     */
+    @Test
+    void setTo_to_from_vacation_same() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime from = LocalTime.of(10, 0);
+        this.vacationDay.setFrom(from);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(from));
+    }
+
+    /**
+     * Tests the method {@code setTo} with same input and starting time and vacation vacation type.
+     */
+    @Test
+    void setTo_to_from_vacation_wrongOrder() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime from = LocalTime.of(20, 0);
+        this.vacationDay.setFrom(from);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(LocalTime.of(10,0)));
+    }
+
     /**
      * Tests the method {@code setTime} with common values where no problem should occur.
      */
     @Test
-    void testSetTime() {
+    void setTime_nullType_valid() {
         LocalTime from = LocalTime.of(10,0);
         LocalTime to = LocalTime.of(20,0);
         this.vacationDay.setTime(from, to);
@@ -44,7 +333,7 @@ class VacationDayTest {
      * Tests the method {@code setTime} with the same times.
      */
     @Test
-    void testSetTimeSame() {
+    void setTime_nullType_same() {
         LocalTime from = LocalTime.of(10,0);
         LocalTime to = LocalTime.of(10,0);
         assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
@@ -54,7 +343,7 @@ class VacationDayTest {
      * Tests the method {@code setTime} with later start.
      */
     @Test
-    void testSetTimeLater() {
+    void setTime_nullType_wrongOrder() {
         LocalTime from = LocalTime.of(20,0);
         LocalTime to = LocalTime.of(10,0);
         assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
@@ -64,7 +353,7 @@ class VacationDayTest {
      * Tests the method {@code setTime} with null {@code from} input.
      */
     @Test
-    void testSetTimeNullFrom() {
+    void setTime_nullFrom_nullType_valid() {
         LocalTime to = LocalTime.of(10,0);
         this.vacationDay.setTime(null, to);
         assertNull(this.vacationDay.getFrom());
@@ -75,7 +364,7 @@ class VacationDayTest {
      * Tests the method {@code setTime} with null {@code to} input.
      */
     @Test
-    void testSetTimeNullTo() {
+    void setTime_nullTo_nullType_valid() {
         LocalTime from = LocalTime.of(20,0);
         this.vacationDay.setTime(from, null);
         assertNull(this.vacationDay.getTo());
@@ -86,124 +375,170 @@ class VacationDayTest {
      * Tests the method {@code setTime} with null input.
      */
     @Test
-    void setSetTimeNull() {
+    void setTime_nullFrom_nullTo_nullType_valid() {
         this.vacationDay.setTime(null, null);
         assertNull(this.vacationDay.getFrom());
         assertNull(this.vacationDay.getTo());
     }
 
     /**
-     * Tests the method {@code setFrom} with common values where no problem should occur.
+     * Tests the method {@code setTime} with null input and sick day vacation type.
      */
     @Test
-    void testSetFrom() {
-        LocalTime to = LocalTime.of(20, 0);
-        this.vacationDay.setTo(to);
-        LocalTime from = LocalTime.of(10,0);
-        this.vacationDay.setFrom(from);
-        assertEquals(from, this.vacationDay.getFrom());
+    void setTime_nullFrom_nullTo_sickDay_valid() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        this.vacationDay.setTime(null, null);
+        assertNull(this.vacationDay.getFrom());
+        assertNull(this.vacationDay.getTo());
     }
 
     /**
-     * Tests the method {@code setFrom} when ending time is null.
+     * Tests the method {@code setTime} with from, null to and sick day vacation type.
      */
     @Test
-    void testSetFromNull() {
-        LocalTime from = LocalTime.of(10,0);
-        this.vacationDay.setFrom(from);
-        assertEquals(from, this.vacationDay.getFrom());
+    void setTime_from_nullTo_sickDay() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(LocalTime.of(10,0), null));
     }
 
     /**
-     * Tests the method {@code setFrom} with the same times.
+     * Tests the method {@code setTime} with null from, to and sick day vacation type.
      */
     @Test
-    void testSetFromSame() {
-        LocalTime to = LocalTime.of(10, 0);
-        this.vacationDay.setTo(to);
-        LocalTime from = LocalTime.of(10,0);
-        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(from));
+    void setTime_nullFrom_to_sickDay() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(null, LocalTime.of(10,0)));
     }
 
     /**
-     * Tests the method {@code setFrom} with later start.
+     * Tests the method {@code setTime} with from, to and sick day vacation type.
      */
     @Test
-    void testSetFromLater() {
-        LocalTime to = LocalTime.of(10, 0);
-        this.vacationDay.setTo(to);
-        LocalTime from = LocalTime.of(20,0);
-        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(from));
+    void setTime_from_to_sickDay() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(LocalTime.of(10,0), LocalTime.of(20,0)));
     }
 
     /**
-     * Tests the method {@code setFrom} with a null input.
+     * Tests the method {@code setTime} with null input and vacation vacation type.
      */
     @Test
-    void testSetFromNullInput() {
-        this.vacationDay.setFrom(null);
-        assertNull(this.vacationDay.getFrom());
+    void setTime_nullFrom_nullTo_vacation() {
+        this.vacationDay.setType(VacationType.VACATION);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(null, null));
     }
 
     /**
-     * Tests the method {@code setTo} with common values where no problem should occur.
+     * Tests the method {@code setTime} with from, null to and vacation vacation type.
      */
     @Test
-    void testSetTo() {
-        LocalTime from = LocalTime.of(10,0);
-        this.vacationDay.setFrom(from);
-        LocalTime to = LocalTime.of(20, 0);
-        this.vacationDay.setTo(to);
-        assertEquals(to, this.vacationDay.getTo());
+    void setTime_from_nullTo_vacation() {
+        this.vacationDay.setType(VacationType.VACATION);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(LocalTime.of(10,0), null));
     }
 
     /**
-     * Tests the method {@code setTo} when starting time is null.
+     * Tests the method {@code setTime} with null from, to and vacation vacation type.
      */
     @Test
-    void testSetToNull() {
-        LocalTime to = LocalTime.of(10,0);
-        this.vacationDay.setTo(to);
+    void setTime_nullFrom_to_vacation() {
+        this.vacationDay.setType(VacationType.VACATION);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(null, LocalTime.of(10,0)));
+    }
+
+    /**
+     * Tests the method {@code setTime} with from, to and vacation vacation type.
+     */
+    @Test
+    void setTime_from_to_vacation_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        LocalTime from = LocalTime.of(10,0);
+        LocalTime to = LocalTime.of(20,0);
+        this.vacationDay.setTime(from, to);
+        assertEquals(from, this.vacationDay.getFrom());
         assertEquals(to, this.vacationDay.getTo());
     }
 
     /**
-     * Tests the method {@code setTo} with the same times.
+     * Tests the method {@code setTime} with same from and to and vacation vacation type.
      */
     @Test
-    void testSetToSame() {
+    void setTime_from_to_vacation_same() {
+        this.vacationDay.setType(VacationType.VACATION);
         LocalTime from = LocalTime.of(10,0);
-        this.vacationDay.setFrom(from);
-        LocalTime to = LocalTime.of(10, 0);
-        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(to));
+        LocalTime to = LocalTime.of(10,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
     }
 
     /**
-     * Tests the method {@code setTo} with earlier end.
+     * Tests the method {@code setTime} with later from than to and vacation vacation type.
      */
     @Test
-    void testSetToEarlier() {
+    void setTime_from_to_vacation_wrongOrder() {
+        this.vacationDay.setType(VacationType.VACATION);
         LocalTime from = LocalTime.of(20,0);
-        this.vacationDay.setFrom(from);
-        LocalTime to = LocalTime.of(10, 0);
-        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(to));
+        LocalTime to = LocalTime.of(10,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
     }
 
     /**
-     * Tests the method {@code setTo} with a null input.
+     * Tests the method {@code setStatus} with common values where no problem should occur.
      */
     @Test
-    void testSetToNullInput() {
-        this.vacationDay.setTo(null);
+    void setStatus_valid() {
+        this.vacationDay.setStatus(Status.ACCEPTED);
+        assertEquals(Status.ACCEPTED, this.vacationDay.getStatus());
+    }
+
+    /**
+     * Tests the method {@code setStatus} with null value.
+     */
+    @Test
+    void setStatus_nullInput() {
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setStatus(null));
+    }
+
+    /**
+     * Tests the method {@code setType} with with vacation input.
+     */
+    @Test
+    void setType_valid() {
+        this.vacationDay.setType(VacationType.VACATION);
+        assertEquals(VacationType.VACATION, this.vacationDay.getType());
+    }
+
+    /**
+     * Tests the method {@code setType} with sick day input.
+     */
+    @Test
+    void setType_sickDay_valid() {
+        this.vacationDay.setType(VacationType.SICK_DAY);
+        assertEquals(VacationType.SICK_DAY, this.vacationDay.getType());
+        assertNull(this.vacationDay.getFrom());
         assertNull(this.vacationDay.getTo());
     }
 
     /**
-     * Tests the method {@code toString} for a vacation.
+     * Tests the method {@code setType} with null value.
+     */
+    @Test
+    void setType_nullInput() {
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setType(null));
+    }
+
+    /**
+     * Tests the method {@code toString}.
      */
     @Test
-    void testToStringVacation() {
-        VacationDay vacationDay = new VacationDay(5, LocalDate.of(2010,1,9), LocalTime.of(12,15), LocalTime.of(22,30), LocalDateTime.of(2008,10,30,20,0), Status.ACCEPTED);
+    void toString_valid() {
+        VacationDay vacationDay = new VacationDay();
+        vacationDay.setId(5L);
+        vacationDay.setDate(LocalDate.of(2010,1,9));
+        vacationDay.setFrom(LocalTime.of(12,15));
+        vacationDay.setTo(LocalTime.of(22,30));
+        vacationDay.setCreationDate(LocalDateTime.of(2008,10,30,20,0));
+        vacationDay.setStatus(Status.ACCEPTED);
+        vacationDay.setType(VacationType.VACATION);
         assertEquals("VacationDay{id=5, date=2010-01-09, from=12:15, to=22:30, creationDate=2008-10-30T20:00, status=ACCEPTED, type=VACATION}", vacationDay.toString());
     }
 
@@ -211,8 +546,8 @@ class VacationDayTest {
      * Tests the method {@code toString} for a sick day.
      */
     @Test
-    void testToStringSickDay() {
-        VacationDay vacationDay = new VacationDay(5, LocalDate.of(2010,1,9), LocalDateTime.of(2008,10,30,20,0), Status.ACCEPTED);
-        assertEquals("VacationDay{id=5, date=2010-01-09, from=null, to=null, creationDate=2008-10-30T20:00, status=ACCEPTED, type=SICK_DAY}", vacationDay.toString());
+    void toString_null() {
+        VacationDay vacationDay = new VacationDay();
+        assertEquals("VacationDay{id=null, date=null, from=null, to=null, creationDate=null, status=null, type=null}", vacationDay.toString());
     }
 }
