### Question:
AlarmClockResource implements Resource { @POST @Path("alarms/{pathid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Alarm editAlarm(@PathParam("pathid") int alarmNumber, Alarm alarmInc) { Alarm alarm = alarmInc; int day; if (this.environment.getCurrentLocalDateTime().getDayOfMonth() == alarm.getAlarmTime().getDayOfMonth()) { day = -1; } else { day = 1; } this.logic.editAlarm(alarmNumber, day, alarm.getAlarmTime().getHour(), alarm.getAlarmTime().getMinute()); return alarm; }  @GET @Path("alarms") @Produces(MediaType.APPLICATION_JSON) List<Alarm> getAllAlarms(); @GET @Path("alarms/{pathid}") @Produces(MediaType.APPLICATION_JSON) Alarm getAlarm(@PathParam("pathid") int alarmnumber); @POST @Path("alarms/{pathid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Alarm editAlarm(@PathParam("pathid") int alarmNumber, Alarm alarmInc); @POST @Path("alarms/de.activate/{pathid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Alarm activatedeactivateAlarm(@PathParam("pathid") int alarmNumber, Alarm alarmInc); @POST @Path("alarms/delete/{pathid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Alarm deleteAlarm(@PathParam("pathid") int alarmNumber); @POST @Path("alarms/new") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Alarm newAlarm(Alarm alarm); @POST @Path("alarms/reset") void resetAlarms(); @Override ResourceEntity getPluginDescripion(); static final String PATH; }### Answer:
@Test void testEditAlarm() { List<Alarm> returnedAlarms = createAlarms(3, true); when(this.acl.editAlarm(1, 1, 10, 20)).thenReturn(returnedAlarms.get(1)); Entity<Alarm> entity = Entity.entity(new Alarm(1, LocalDateTime.of(2018, 8, 23, 12, 12), true), MediaType.APPLICATION_JSON); Response response = this.target.path("alarms/delete/1").request().post(entity); assertThat(response, status(204)); verify(this.acl).deleteAlarm(1); }