@Test public void testDeleteAggregator() throws DoesNotExistException { Mockito.when(response.getStatus()).thenReturn(200); aa.deleteAggregator("A0r0"); }
public void deleteAggregator(String aggregatorId) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + AggregatorOptionListContainer.AGGREGATORS + "/" + aggregatorId); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteAggregator(..) success!"); }
AggregatorsAccessor { public void deleteAggregator(String aggregatorId) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + AggregatorOptionListContainer.AGGREGATORS + "/" + aggregatorId); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteAggregator(..) success!"); } }
AggregatorsAccessor { public void deleteAggregator(String aggregatorId) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + AggregatorOptionListContainer.AGGREGATORS + "/" + aggregatorId); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteAggregator(..) success!"); } AggregatorsAccessor(URL restUrl, String username, String password);   AggregatorsAccessor(URL restUrl, String username, String password, Client client); }
AggregatorsAccessor { public void deleteAggregator(String aggregatorId) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + AggregatorOptionListContainer.AGGREGATORS + "/" + aggregatorId); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteAggregator(..) success!"); } AggregatorsAccessor(URL restUrl, String username, String password);   AggregatorsAccessor(URL restUrl, String username, String password, Client client); Aggregator getAggregator(String aggregatorId); void deleteAggregator(String aggregatorId); List<Aggregator> getAggregatorList(int offset, int number); void createAggregator(String id, String name, String nameCode, String homepage); void updateAggregator(String id, String newId, String name, String nameCode,
      String homepage); URL getRestUrl(); void setRestUrl(URL restUrl); }
AggregatorsAccessor { public void deleteAggregator(String aggregatorId) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + AggregatorOptionListContainer.AGGREGATORS + "/" + aggregatorId); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteAggregator(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteAggregator(..) success!"); } AggregatorsAccessor(URL restUrl, String username, String password);   AggregatorsAccessor(URL restUrl, String username, String password, Client client); Aggregator getAggregator(String aggregatorId); void deleteAggregator(String aggregatorId); List<Aggregator> getAggregatorList(int offset, int number); void createAggregator(String id, String name, String nameCode, String homepage); void updateAggregator(String id, String newId, String name, String nameCode,
      String homepage); URL getRestUrl(); void setRestUrl(URL restUrl);  }