DefaultImageService extends DefaultService implements ImageService { @Override public byte[] getImageById(String imageId) { requireArgument((imageId != null && imageId.length()>0), "imageId cannot be null or Empty"); return imageStorageService.getImage(imageId); } @Inject protected  DefaultImageService(ImageStorageService imageStorageService,SystemConfiguration config); @Override byte[] generateImage(List<Metric> metrics, ImageProperties imageProperties); @Override String storeImage(byte[] imageBytes, boolean sync); @Override Pair<String,byte[]> generateAndStoreImage(List<Metric> metrics, ImageProperties imageProperties, boolean sync); @Override byte[] getImageById(String imageId);  }
@Test(expected=IllegalArgumentException.class) public void testNullOREmptyImageId() { defaultImageService.getImageById(null); defaultImageService.getImageById(""); }