@Test public void testCropLower() throws IOException { Resource config = new MockResource("/conf", Collections.singletonMap(CropHandler.PN_POSITION, "center"), Mockito.mock(ResourceResolver.class)); cropper.handle(builder, config); assertNotNull(builder.asBufferedImage()); }
@Override public void handle(Builder<? extends InputStream> builder, Resource config) throws IOException { String positionStr = config.getValueMap().get(PN_POSITION, "CENTER").toUpperCase(); try { Positions pos = Positions.valueOf(positionStr); builder.crop(pos); } catch (IllegalArgumentException e) { throw new IOException("Unable to load crop position from " + positionStr, e); } }
CropHandler implements TransformationHandler { @Override public void handle(Builder<? extends InputStream> builder, Resource config) throws IOException { String positionStr = config.getValueMap().get(PN_POSITION, "CENTER").toUpperCase(); try { Positions pos = Positions.valueOf(positionStr); builder.crop(pos); } catch (IllegalArgumentException e) { throw new IOException("Unable to load crop position from " + positionStr, e); } } }
CropHandler implements TransformationHandler { @Override public void handle(Builder<? extends InputStream> builder, Resource config) throws IOException { String positionStr = config.getValueMap().get(PN_POSITION, "CENTER").toUpperCase(); try { Positions pos = Positions.valueOf(positionStr); builder.crop(pos); } catch (IllegalArgumentException e) { throw new IOException("Unable to load crop position from " + positionStr, e); } }  }
CropHandler implements TransformationHandler { @Override public void handle(Builder<? extends InputStream> builder, Resource config) throws IOException { String positionStr = config.getValueMap().get(PN_POSITION, "CENTER").toUpperCase(); try { Positions pos = Positions.valueOf(positionStr); builder.crop(pos); } catch (IllegalArgumentException e) { throw new IOException("Unable to load crop position from " + positionStr, e); } }  @Override String getResourceType(); @Override void handle(Builder<? extends InputStream> builder, Resource config); }
CropHandler implements TransformationHandler { @Override public void handle(Builder<? extends InputStream> builder, Resource config) throws IOException { String positionStr = config.getValueMap().get(PN_POSITION, "CENTER").toUpperCase(); try { Positions pos = Positions.valueOf(positionStr); builder.crop(pos); } catch (IllegalArgumentException e) { throw new IOException("Unable to load crop position from " + positionStr, e); } }  @Override String getResourceType(); @Override void handle(Builder<? extends InputStream> builder, Resource config); static final String PN_POSITION; }