ImageServiceImpl extends BaseGenericServiceImpl<SeoImage> implements ImageService { @Override public SeoImage getSeoImage(final String imageName) { final List<SeoImage> seoImages = seoImageDao.findByCriteria(" where e.imageName = ?1", imageName); if (seoImages == null || seoImages.isEmpty()) { return null; } return seoImages.get(0); } ImageServiceImpl(final GenericDAO<SeoImage, Long> seoImageDao,
                            final MediaFileNameStrategyResolver mediaFileNameStrategyResolver,
                            final String allowedSizes,
                            final int borderColorR,
                            final int borderColorG,
                            final int borderColorB,
                            final boolean cropToFit,
                            final int forceCropToFitOnSize,
                            final boolean replaceFilesModeOn,
                            final IOProvider ioProvider); void setConfig(final Resource config); @Override byte[] resizeImage(final String filename,
                              final byte[] content,
                              final String width,
                              final String height); @Override byte[] resizeImage(final String filename,
                              final byte[] content,
                              final String width,
                              final String height,
                              final boolean cropToFit); @Override boolean isSizeAllowed(final String size); @Override boolean isSizeAllowed(final String width, final String height); @Override MediaFileNameStrategy getImageNameStrategy(final String url); @Override byte[] resizeImage(final String original,
                              final String resized,
                              final String width,
                              final String height); @Override byte[] resizeImage(final String original,
                              final String resized,
                              final String width,
                              final String height,
                              final boolean cropToFit); @Override boolean isImageInRepository(final String fullFileName,
                                       final String code,
                                       final String storagePrefix,
                                       final String pathToRepository); @Override String addImageToRepository(final String fullFileName,
                                       final String code,
                                       final byte[] imgBody,
                                       final String storagePrefix,
                                       final String pathToRepository); @Override byte[] imageToByteArray(final String fileName,
                                   final String code,
                                   final String storagePrefix,
                                   final String pathToRepository); @Override boolean deleteImage(final String imageFileName,
                               final String storagePrefix,
                               final String pathToRepository); @Override SeoImage getSeoImage(final String imageName); SystemService getSystemService();  }
@Test public void testGetSeoImage() throws Exception { SeoImage seoImage = imageService.getSeoImage(Constants.PRODUCT_IMAGE_REPOSITORY_URL_PATTERN + imageName); assertNotNull("Cannot find image with name " + imageName, seoImage); }