@Test public void checkImageShouldRaiseExceptionIfItDoesNotExist() { String[] imagesIds = {"imageId1", "imageId2"}; exception.expect(WebApplicationException.class); inputValidator.checkImageExists("imageId3", new ArrayList<>(Arrays.asList(imagesIds))); }
public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } }
VmmRestInputValidator { public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } } }
VmmRestInputValidator { public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } }  }
VmmRestInputValidator { public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } }  void checkVmDescriptions(JsonObject vmsJson); void checkVmExists(boolean vmExists); void checkImageExists(String imageId, List<String> imagesIds); void checkImageDescription(ImageToUpload imageToUpload); void checkJsonActionFormat(JsonObject jsonObject); void checkHostExists(boolean hostExists); }
VmmRestInputValidator { public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } }  void checkVmDescriptions(JsonObject vmsJson); void checkVmExists(boolean vmExists); void checkImageExists(String imageId, List<String> imagesIds); void checkImageDescription(ImageToUpload imageToUpload); void checkJsonActionFormat(JsonObject jsonObject); void checkHostExists(boolean hostExists);  }