### Question:
ArchivedUserTaskContextResource extends CommonResource { protected long getArchivedTaskIdParameter() { final String taskId = getAttribute(ARCHIVED_TASK_ID); if (taskId == null) { throw new APIException("Attribute '" + ARCHIVED_TASK_ID + "' is mandatory in order to get the archived task context"); } return Long.parseLong(taskId); } ArchivedUserTaskContextResource(final ProcessAPI processAPI, FinderFactory resourceHandler); @Get("json") Map<String, Serializable> getArchivedUserTaskContext();  }### Answer:
@Test public void should_getArchivedTaskIDParameter_throws_an_exception_when_archived_task_id_parameter_is_null() throws Exception { doReturn(null).when(archviedTaskContextResource).getAttribute(ArchivedUserTaskContextResource.ARCHIVED_TASK_ID); try { archviedTaskContextResource.getArchivedTaskIdParameter(); } catch (final Exception e) { Assertions.assertThat(e).isInstanceOf(APIException.class); Assertions.assertThat(e.getMessage()).isEqualTo("Attribute '" +ArchivedUserTaskContextResource.ARCHIVED_TASK_ID + "' is mandatory in order to get the archived task context"); } }