### Question:
DailyHandler implements SchedulingHandler { public void checkSettings(VObjectData object, Map<String, Object> settings, String callerKey) throws MissingSettingException, InvalidSettingException { if (settings.isEmpty()) { throw new MissingSettingException("scheduling"); } for (final Entry<String, Object> anEntry : settings.entrySet()) { if (!DailyHandler.Weekday.isValidLabel(anEntry.getKey())) { throw new InvalidSettingException("day", anEntry.getKey()); } final Object atom = anEntry.getValue(); if ((atom != null) && !isAtomValid(atom)) { throw new InvalidSettingException("atom", String.valueOf(atom)); } } }  Map<String, String> generateSettings(VObjectData object, Map<String, Object> settings, String callerKey); void checkSettings(VObjectData object, Map<String, Object> settings, String callerKey); void deleteElements(SubscriptionSchedulingData scheduling); void executeWhenDone(SubscriptionSchedulingData scheduling); SchedulingInformationMap getSchedulingInformation(SubscriptionSchedulingData scheduling, APICaller caller);  }### Answer:
@Test(expected = MissingSettingException.class) public void emptySettingsTest() throws MissingSettingException, InvalidSettingException { final VObjectData theObject = VObjectData.getData(getKowalskyObject()); new DailyHandler().checkSettings(theObject, Collections.<String, Object> emptyMap(), null); }
@Test(expected = InvalidSettingException.class) public void invalidDayTest() throws MissingSettingException, InvalidSettingException { final VObjectData theObject = VObjectData.getData(getKowalskyObject()); final Map<String, Object> settings = new HashMap<String, Object>(); settings.put("invalid", null); new DailyHandler().checkSettings(theObject, settings, null); }
@Test(expected = InvalidSettingException.class) public void invalidAtomTest() throws MissingSettingException, InvalidSettingException { final VObjectData theObject = VObjectData.getData(getKowalskyObject()); final Map<String, Object> settings = new HashMap<String, Object>(); final Map<String, Object> atom = new HashMap<String, Object>(); atom.put("toto", "toto"); atom.put("titi", "titi"); settings.put(DailyHandler.Weekday.MONDAY.getValue(), atom); new DailyHandler().checkSettings(theObject, settings, null); }
@Test(expected = InvalidSettingException.class) public void invalidAtomAgainTest() throws MissingSettingException, InvalidSettingException { final VObjectData theObject = VObjectData.getData(getKowalskyObject()); final Map<String, Object> settings = new HashMap<String, Object>(); final Map<String, Object> atom = new HashMap<String, Object>(); atom.put(SchedulingAtom.HOUR, 28); atom.put(SchedulingAtom.MINUTE, -4); settings.put(DailyHandler.Weekday.MONDAY.getValue(), atom); new DailyHandler().checkSettings(theObject, settings, null); }
@Test public void validTest() { final VObjectData theObject = VObjectData.getData(getKowalskyObject()); final Map<String, Object> settings = new HashMap<String, Object>(); final Map<String, Object> atom = new HashMap<String, Object>(); atom.put(SchedulingAtom.HOUR, 12); atom.put(SchedulingAtom.MINUTE, 4); final Map<String, Object> atom2 = new HashMap<String, Object>(); atom2.put(SchedulingAtom.HOUR, 14); atom2.put(SchedulingAtom.MINUTE, 45); settings.put(DailyHandler.Weekday.MONDAY.getValue(), atom); settings.put(DailyHandler.Weekday.WEDNESDAY.getValue(), atom2); try { new DailyHandler().checkSettings(theObject, settings, null); } catch (final Exception e) { Assert.fail(); } }