@Test public void outputTimerNowTest() { Map<String, EntityData> map = new HashMap<>(); when(this.number.getNumber()).thenReturn(1); map.put("number", this.number); LocalDateTime timerDate = LocalDateTime.of(2018, 9, 6, 12, 11, 10); Timer t = new Timer(1, timerDate, Duration.ZERO, false); when(this.tLogic.getTimer(1)).thenReturn(t); assertThat(this.tSpeech.getTimerObject(map), is("Timer 1 is ringing right now.")); }
@Intent public String getTimerObject(Map<String, EntityData> entities) { try { Timer timer = this.timerLogic.getTimer(entities.get(NUMBER_MAP_KEY).getNumber()); return outputTimer(timer); } catch (NoSuchElementException e) { this.logException(e); return ELEMENTNOTFOUND; } }
TimerSpeech { @Intent public String getTimerObject(Map<String, EntityData> entities) { try { Timer timer = this.timerLogic.getTimer(entities.get(NUMBER_MAP_KEY).getNumber()); return outputTimer(timer); } catch (NoSuchElementException e) { this.logException(e); return ELEMENTNOTFOUND; } } }
TimerSpeech { @Intent public String getTimerObject(Map<String, EntityData> entities) { try { Timer timer = this.timerLogic.getTimer(entities.get(NUMBER_MAP_KEY).getNumber()); return outputTimer(timer); } catch (NoSuchElementException e) { this.logException(e); return ELEMENTNOTFOUND; } }  }
TimerSpeech { @Intent public String getTimerObject(Map<String, EntityData> entities) { try { Timer timer = this.timerLogic.getTimer(entities.get(NUMBER_MAP_KEY).getNumber()); return outputTimer(timer); } catch (NoSuchElementException e) { this.logException(e); return ELEMENTNOTFOUND; } }  @Intent String setTimer(Map<String, EntityData> entities); @Intent String pauseTimer(Map<String, EntityData> entities); @Intent String reactivateTimer(Map<String, EntityData> entities); @Intent String resetTimerObjects(Map<String, EntityData> entities); @Intent String deleteTimerObject(Map<String, EntityData> entities); @Intent String stopRinging(Map<String, EntityData> entities); @Intent String getTimerObject(Map<String, EntityData> entities); @Intent String getAllTimerObjects(Map<String, EntityData> entities); @Intent String getRemainingTimerDelay(Map<String, EntityData> entities); }
TimerSpeech { @Intent public String getTimerObject(Map<String, EntityData> entities) { try { Timer timer = this.timerLogic.getTimer(entities.get(NUMBER_MAP_KEY).getNumber()); return outputTimer(timer); } catch (NoSuchElementException e) { this.logException(e); return ELEMENTNOTFOUND; } }  @Intent String setTimer(Map<String, EntityData> entities); @Intent String pauseTimer(Map<String, EntityData> entities); @Intent String reactivateTimer(Map<String, EntityData> entities); @Intent String resetTimerObjects(Map<String, EntityData> entities); @Intent String deleteTimerObject(Map<String, EntityData> entities); @Intent String stopRinging(Map<String, EntityData> entities); @Intent String getTimerObject(Map<String, EntityData> entities); @Intent String getAllTimerObjects(Map<String, EntityData> entities); @Intent String getRemainingTimerDelay(Map<String, EntityData> entities);  }