@Test public void testDeleteMapping() throws DoesNotExistException { Mockito.when(response.getStatus()).thenReturn(200); ma.deleteMapping("map0"); }
public void deleteMapping(String id) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + MappingOptionListContainer.MAPPINGS + "/" + id); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteMapping(..) success!"); }
MappingsAccessor { public void deleteMapping(String id) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + MappingOptionListContainer.MAPPINGS + "/" + id); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteMapping(..) success!"); } }
MappingsAccessor { public void deleteMapping(String id) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + MappingOptionListContainer.MAPPINGS + "/" + id); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteMapping(..) success!"); } MappingsAccessor(URL restUrl, String username, String password);   MappingsAccessor(URL restUrl, String username, String password, Client client); }
MappingsAccessor { public void deleteMapping(String id) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + MappingOptionListContainer.MAPPINGS + "/" + id); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteMapping(..) success!"); } MappingsAccessor(URL restUrl, String username, String password);   MappingsAccessor(URL restUrl, String username, String password, Client client); MetadataTransformation getMapping(String id); void deleteMapping(String id); void createMapping(MetadataTransformation metadataTransformation, File file); void updateMapping(String id, MetadataTransformation metadataTransformation, File file); }
MappingsAccessor { public void deleteMapping(String id) throws DoesNotExistException, InternalServerErrorException { WebTarget target = client.target(restUrl + "/" + MappingOptionListContainer.MAPPINGS + "/" + id); Response response = target.request(MediaType.APPLICATION_JSON).delete(); if (response.getStatus() == 404) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new DoesNotExistException(errorMessage.getResult()); } else if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("deleteMapping(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } LOGGER.info("deleteMapping(..) success!"); } MappingsAccessor(URL restUrl, String username, String password);   MappingsAccessor(URL restUrl, String username, String password, Client client); MetadataTransformation getMapping(String id); void deleteMapping(String id); void createMapping(MetadataTransformation metadataTransformation, File file); void updateMapping(String id, MetadataTransformation metadataTransformation, File file);  }