### Question:
FederationV2CapacityGroupResource { @GET @Path("/{applicationName}") public ApplicationSlaRepresentation getApplicationSLA(@PathParam("applicationName") String applicationName, @QueryParam("extended") boolean extended) { Either<ApplicationSlaRepresentation, WebApplicationException> result = CellWebClientConnectorUtil.doGetFromCell( cellWebClientConnector, API_PATH + '/' + applicationName + "?extended=" + extended, APPLICATION_SLA_TP, configuration.getRestRequestTimeoutMs() ); if (result.hasError()) { throw result.getError(); } return result.getValue(); } @Inject  FederationV2CapacityGroupResource(EndpointConfiguration configuration,
                                             CellWebClientConnector cellWebClientConnector); @GET List<ApplicationSlaRepresentation> getApplicationSLAs(@QueryParam("extended") boolean extended); @GET @Path("/{applicationName}") ApplicationSlaRepresentation getApplicationSLA(@PathParam("applicationName") String applicationName,
                                                          @QueryParam("extended") boolean extended); static final String BASE_PATH; static final String API_PATH; }### Answer:
@Test public void testGetCapacityGroup() { ApplicationSlaRepresentation result = resource.getApplicationSLA(CELL_1_CAPACITY_GROUP.getAppName(), false); assertThat(result).isNotNull(); }
@Test public void testGetCapacityGroupNotFound() { try { resource.getApplicationSLA("myFakeCapacityGroup", false); } catch (WebApplicationException e) { assertThat(e.getResponse().getStatus()).isEqualTo(404); } }
@Test public void testGetCapacityGroupSystemError() throws IOException { cell1Server.shutdown(); try { resource.getApplicationSLA("myFakeCapacityGroup", false); } catch (WebApplicationException e) { assertThat(e.getResponse().getStatus()).isEqualTo(500); } }