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