### Question:
BujintMojo extends AbstractMojo { BufferedImage getFittingImage(String url) throws Exception { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = buildDefaultHttpMessage(new HttpGet(url)); httpget.setHeader("Referer", "http: HttpResponse response = httpclient.execute(httpget); BufferedImage image = ImageIO.read(response.getEntity().getContent()); httpclient.getConnectionManager().shutdown(); int width = image.getWidth() / 10 * 4; int height = image.getHeight() / 10 * 4; BufferedImage resizedImage = null; resizedImage = new BufferedImage(width, height, image.getType()); resizedImage.getGraphics().drawImage( image.getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING), 0, 0, width, height, null); return resizedImage; }  void execute();  }### Answer:
@Test public void testGetFittingImage() throws Exception { BujintMojo target = new BujintMojo(); BufferedImage image = target.getFittingImage(target.nowTimeImageUrl()); ImageIO.write(image, "jpg", new File("test.jpg")); }