@Test
public void testResize() throws IOException {
InputSettings inputSettings = new InputSettings();
OutputSettings outputSettings = new OutputSettings(OutputEncoding.PNG);
Image originalImage = readImage(CAPEDWARF_PNG);
assertEquals(200, originalImage.getWidth());
assertEquals(143, originalImage.getHeight());
originalImage = readImage(CAPEDWARF_PNG);
Image resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(400, 286), originalImage);
assertEquals(400, resizedImage.getWidth());
assertEquals(286, resizedImage.getHeight());
originalImage = readImage(CAPEDWARF_PNG);
resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(400, 286), originalImage));
assertEquals(400, resizedImage.getWidth());
assertEquals(286, resizedImage.getHeight());
originalImage = readImage(CAPEDWARF_PNG);
resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(300, 286), originalImage, inputSettings, outputSettings);
assertEquals(300, resizedImage.getWidth());
assertEquals(215, resizedImage.getHeight());
originalImage = readImage(CAPEDWARF_PNG);
resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(300, 286), originalImage, inputSettings, outputSettings));
assertEquals(300, resizedImage.getWidth());
assertEquals(215, resizedImage.getHeight());
originalImage = readImage(CAPEDWARF_PNG);
resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(400, 200), originalImage, outputSettings);
assertEquals(280, resizedImage.getWidth());
assertEquals(200, resizedImage.getHeight());
}