FederationV2CapacityGroupResource { @GET public List<ApplicationSlaRepresentation> getApplicationSLAs(@QueryParam("extended") boolean extended) { Either<List<ApplicationSlaRepresentation>, WebApplicationException> result = CellWebClientConnectorUtil.doGetAndMerge( cellWebClientConnector, API_PATH + "?extended=" + extended, APPLICATION_SLA_LIST_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; }
@Test public void testGetCapacityGroups() { List<ApplicationSlaRepresentation> result = resource.getApplicationSLAs(false); assertThat(result).isNotNull(); assertThat(result).hasSize(2); }
@Test public void testGetCapacityGroupsSystemError() throws IOException { cell1Server.shutdown(); try { resource.getApplicationSLAs(false); } catch (WebApplicationException e) { assertThat(e.getResponse().getStatus()).isEqualTo(500); } }