DaemonConfiguration { public int getShutdownAwaitTime() { return this.shutdownAwaitTime; } @JsonCreator  DaemonConfiguration(@JsonProperty("monitors")List<MonitorConfiguration> monitors,
                               @JsonProperty("shutdownAwaitTime")Integer shutdownAwaitTime); int getShutdownAwaitTime(); List<MonitorConfiguration> getMonitors(); static final int DEFAULT_SHUTDOWN_AWAIT_TIME; }
@Test void test_default_shutdown_await_time() { List<MonitorConfiguration> monitors = new ArrayList<>(); monitors.add(new MonitorConfiguration("com.company.Monitor", null)); DaemonConfiguration daemonConfiguration = new DaemonConfiguration(monitors, null); Assertions.assertEquals(DaemonConfiguration.DEFAULT_SHUTDOWN_AWAIT_TIME, daemonConfiguration.getShutdownAwaitTime()); }
@Test void test_zero_shutdown_await_time() { List<MonitorConfiguration> monitors = new ArrayList<>(); monitors.add(new MonitorConfiguration("com.company.Monitor", null)); DaemonConfiguration daemonConfiguration = new DaemonConfiguration(monitors, 0); Assertions.assertEquals(DaemonConfiguration.DEFAULT_SHUTDOWN_AWAIT_TIME, daemonConfiguration.getShutdownAwaitTime()); }
@Test void test_negative_shutdown_await_time() { List<MonitorConfiguration> monitors = new ArrayList<>(); monitors.add(new MonitorConfiguration("com.company.Monitor", null)); DaemonConfiguration daemonConfiguration = new DaemonConfiguration(monitors, -1); Assertions.assertEquals(DaemonConfiguration.DEFAULT_SHUTDOWN_AWAIT_TIME, daemonConfiguration.getShutdownAwaitTime()); }
@Test void test_valid_shutdown_await_time() { List<MonitorConfiguration> monitors = new ArrayList<>(); monitors.add(new MonitorConfiguration("com.company.Monitor", null)); Integer shutdownAwaitTime = 1000; DaemonConfiguration daemonConfiguration = new DaemonConfiguration(monitors, shutdownAwaitTime); Assertions.assertEquals(shutdownAwaitTime.intValue(), daemonConfiguration.getShutdownAwaitTime()); }