commit da24dbb4e0d4d29038de1bde6d1428a6181b9989
Author: D0miq <dpoch@email.com>
Date:   Wed Jun 5 21:04:56 2019 +0200

    Final version of the class DefaultSettings with its tests

diff --git a/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
index feaa8b6..4ae7124 100644
--- a/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
+++ b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
@@ -20,12 +20,12 @@ public class DefaultSettings {
     /**
      * The ID of default settings.
      */
-    private final long id;
+    private Long id;
 
     /**
      * The default number of available sick days.
      */
-    private int sickDayCount;
+    private Integer sickDayCount;
 
     /**
      * The default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
@@ -33,49 +33,23 @@ public class DefaultSettings {
     private LocalDateTime notification;
 
     /**
-     * Creates an empty default settings for testing purposes only.
-     * It just sets id to zero.
-     */
-    public DefaultSettings() {
-        DefaultSettings.log.trace("Creating a new instance of the class DefaultSettings.");
-        this.id = 0;
-    }
-
-    /**
-     * Creates a new default settings with the specified number of available sick days, date and time of a notification.
+     * Returns the ID of this default settings.
      *
-     * @param sickDayCount the default number of available sick days
-     * @param notification the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
-     * @throws IllegalArgumentException when the given sickDayCount value is negative
+     * @return the ID of this default settings
      */
-    public DefaultSettings(final Integer sickDayCount, final LocalDateTime notification) throws IllegalArgumentException {
-        this(0, sickDayCount, notification);
+    public Long getId() {
+        return this.id;
     }
 
     /**
-     * Creates a new default settings with the specified id, number of available sick days, date and time of a notification.
+     * Replaces the ID of this default settings with the given one.
      *
-     * @param id           the ID of default settings
-     * @param sickDayCount the default number of available sick days
-     * @param notification the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
-     * @throws IllegalArgumentException when the given sickDayCount value is negative
+     * @param id the given ID
      */
-    public DefaultSettings(final long id, final Integer sickDayCount, final LocalDateTime notification) throws IllegalArgumentException {
-        DefaultSettings.log.trace("Creating a new instance of the class DefaultSettings");
-        DefaultSettings.log.debug("DefaultSettings: id={}, sickDayCount={}, notification={}", id, sickDayCount, notification);
+    public void setId(final Long id) {
+        DefaultSettings.log.debug("Setting a new id: {}", id);
 
         this.id = id;
-        this.setSickDayCount(sickDayCount);
-        this.setNotification(notification);
-    }
-
-    /**
-     * Returns the ID of this default settings.
-     *
-     * @return the ID of this default settings
-     */
-    public long getId() {
-        return this.id;
     }
 
     /**
diff --git a/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java b/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java
index a5bdff9..db07fcc 100644
--- a/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java
+++ b/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java
@@ -31,7 +31,7 @@ class DefaultSettingsTest {
      * Tests the method {@code setSickDayCount} with common values where no problem should occur.
      */
     @Test
-    void testSetSickDaysCount() {
+    void setSickDaysCount_valid() {
         this.defaultSettings.setSickDayCount(10);
         assertEquals(10, this.defaultSettings.getSickDayCount());
     }
@@ -40,7 +40,7 @@ class DefaultSettingsTest {
      * Tests the method {@code setSickDayCount} with zero which is a threshold value.
      */
     @Test
-    void testSetSickDaysCountZero() {
+    void setSickDaysCount_zeroInput() {
         this.defaultSettings.setSickDayCount(0);
         assertEquals(0, this.defaultSettings.getSickDayCount());
     }
@@ -49,7 +49,7 @@ class DefaultSettingsTest {
      * Tests the method {@code setSickDayCount} with negative one which is a threshold value.
      */
     @Test
-    void testSetSickDaysCountNegativeOne() {
+    void setSickDaysCount_negativeOneInput() {
         assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setSickDayCount(-1));
     }
 
@@ -57,7 +57,7 @@ class DefaultSettingsTest {
      * Tests the method {@code setSickDayCount} with negative value.
      */
     @Test
-    void testSetSickDaysCountNegative() {
+    void setSickDaysCount_negativeInput() {
         assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setSickDayCount(-10));
     }
 
@@ -65,16 +65,36 @@ class DefaultSettingsTest {
      * Tests the method {@code setSickDayCount} with null value.
      */
     @Test
-    void testSetSickDaysCountObjectNull() {
+    void setSickDaysCount_nullInput() {
         assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setSickDayCount(null));
     }
 
+    /**
+     * Tests the method {@code setNotification} with common values where no problem should occur.
+     */
+    @Test
+    void setNotification_valid() {
+        this.defaultSettings.setNotification(LocalDateTime.of(2010,5,1,20,0));
+        assertEquals(LocalDateTime.of(2010,5,1,20,0), this.defaultSettings.getNotification());
+    }
+
+    /**
+     * Tests the method {@code setNotification} with null value.
+     */
+    @Test
+    void setNotification_nullInput() {
+        assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setNotification(null));
+    }
+
     /**
      * Tests the method {@code toString}.
      */
     @Test
     void testToString() {
-        DefaultSettings defaultSettings = new DefaultSettings(5, 1, LocalDateTime.of(2008,10,30,20,0));
+        DefaultSettings defaultSettings = new DefaultSettings();
+        defaultSettings.setId(5L);
+        defaultSettings.setSickDayCount(1);
+        defaultSettings.setNotification(LocalDateTime.of(2008,10,30,20,0));
         assertEquals("DefaultSettings{id=5, sickDayCount=1, notification=2008-10-30T20:00}", defaultSettings.toString());
     }
 }
