### Question:
PurgeApiAuthorizationFilter extends SpaceNameBasedAuthorizationFilter { @Override protected CloudTarget extractTarget(HttpServletRequest request) { String organizationName = request.getParameter(ConfigurationEntriesResource.REQUEST_PARAM_ORGANIZATION); String spaceName = request.getParameter(ConfigurationEntriesResource.REQUEST_PARAM_SPACE); if (StringUtils.isAnyEmpty(organizationName, spaceName)) { throw new SLException(Messages.ORG_AND_SPACE_MUST_BE_SPECIFIED); } return new CloudTarget(organizationName, spaceName); } @Inject  PurgeApiAuthorizationFilter(AuthorizationChecker authorizationChecker); @Override String getUriRegex();  }### Answer:
@Test void testExtractTarget() { Mockito.when(request.getParameter(ConfigurationEntriesResource.REQUEST_PARAM_ORGANIZATION)) .thenReturn(ORGANIZATION_NAME); Mockito.when(request.getParameter(ConfigurationEntriesResource.REQUEST_PARAM_SPACE)) .thenReturn(SPACE_NAME); assertEquals(new CloudTarget(ORGANIZATION_NAME, SPACE_NAME), purgeApiAuthorizationFilter.extractTarget(request)); }
@Test void testExtractTargetWithMissingParameters() { assertThrows(SLException.class, () -> purgeApiAuthorizationFilter.extractTarget(request)); }