@Test public void setTimerInvalidTest() { Map<String, EntityData> map = new HashMap<>(); when(this.hour.getNumber()).thenReturn(0); when(this.minute.getNumber()).thenReturn(0); when(this.second.getNumber()).thenReturn(0); map.put("hour", this.hour); map.put("minute", this.minute); map.put("second", this.second); assertThat(this.tSpeech.setTimer(map), is("No value is set")); }
@Intent public String setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; }
TimerSpeech { @Intent public String setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; } }
TimerSpeech { @Intent public String setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; }  }
TimerSpeech { @Intent public String setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; }  @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 setTimer(Map<String, EntityData> entities) { int hours = 0; int minutes = 0; int seconds = 0; if (entities.get("hour") != null) { hours = entities.get("hour").getNumber(); } if (entities.get("minute") != null) { minutes = entities.get("minute").getNumber(); } if (entities.get("second") != null) { seconds = entities.get("second").getNumber(); } if (hours == 0 && minutes == 0 && seconds == 0) { return "No value is set"; } LocalDateTime timerDate = LocalDateTime.now().plusHours(hours).plusMinutes(minutes).plusSeconds(seconds) .truncatedTo(ChronoUnit.SECONDS); Timer timer = this.timerLogic.setTimer(timerDate); return timerS + timer.getId() + " set"; }  @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);  }