### Question:
TimerEventTriggerResource extends CommonResource { @Put("json") public TimerEventTrigger updateTimerEventTrigger(final TimerEventTrigger trigger) throws Exception { final String triggerId = getAttribute(ID_PARAM_NAME); if (triggerId == null) { throw new APIException("Attribute '" + ID_PARAM_NAME + "' is mandatory"); } final long timerEventTriggerInstanceId = Long.parseLong(triggerId); final Date executionDate = new Date(trigger.getExecutionDate()); return createTimerEventTrigger(processAPI.updateExecutionDateOfTimerEventTriggerInstance(timerEventTriggerInstanceId, executionDate) .getTime()); } TimerEventTriggerResource(final ProcessAPI processAPI); @Get("json") void searchTimerEventTriggers(); @Put("json") TimerEventTrigger updateTimerEventTrigger(final TimerEventTrigger trigger); @Override String getAttribute(final String attributeName); static final String ID_PARAM_NAME; }### Answer:
@Test(expected = APIException.class) public void updateShouldHandleNullID() throws Exception { doReturn(Collections.EMPTY_MAP).when(restResource).getRequestAttributes(); restResource.updateTimerEventTrigger(null); }