DefaultImageService extends DefaultService implements ImageService { @Override public String storeImage(byte[] imageBytes, boolean sync) { requireArgument((imageBytes != null && imageBytes.length>0), "imageBytes cannot be null or Empty"); String imageId= ImageUtils.convertBytesToMd5Hash(imageBytes); imageStorageService.putImage(imageId,imageBytes,sync); return 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 testStoreNullImageBytes() { defaultImageService.storeImage(null,false); defaultImageService.storeImage("".getBytes(),false); }