### Question:
UserTaskExecutionResource extends CommonResource { protected long getTaskIdParameter() { final String taskId = getAttribute(TASK_ID); if (taskId == null) { throw new APIException("Attribute '" + TASK_ID + "' is mandatory"); } return Long.parseLong(taskId); } UserTaskExecutionResource(final ProcessAPI processAPI, final APISession apiSession); @Post("json") void executeTask(final Map<String, Serializable> inputs);  }### Answer:
@Test public void should_getProcessDefinitionIdParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception { doReturn(null).when(userTaskExecutionResource).getAttribute(UserTaskExecutionResource.TASK_ID); try { userTaskExecutionResource.getTaskIdParameter(); } catch (final Exception e) { assertThat(e).isInstanceOf(APIException.class); assertThat(e.getMessage()).isEqualTo("Attribute '" + UserTaskExecutionResource.TASK_ID + "' is mandatory"); } }