### Question:
ProcessInstantiationResource extends CommonResource { protected long getProcessDefinitionIdParameter() { final String processDefinitionId = getAttribute(PROCESS_DEFINITION_ID); if (processDefinitionId == null) { throw new APIException("Attribute '" + PROCESS_DEFINITION_ID + "' is mandatory"); } return Long.parseLong(processDefinitionId); } ProcessInstantiationResource(final ProcessAPI processAPI, final APISession apiSession); @Post("json") String instantiateProcess(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(processInstantiationResource).getAttribute(ProcessInstantiationResource.PROCESS_DEFINITION_ID); try { processInstantiationResource.getProcessDefinitionIdParameter(); } catch (final Exception e) { assertThat(e).isInstanceOf(APIException.class); assertThat(e.getMessage()).isEqualTo("Attribute '" + ProcessInstantiationResource.PROCESS_DEFINITION_ID + "' is mandatory"); } }