[LIB-9] Modify ChessQRCodeWriterTest core dbetude master qrcode
authorgotty <gotty@hedgecode.org>
Sat, 25 Jan 2020 01:06:44 +0000 (04:06 +0300)
committergotty <gotty@hedgecode.org>
Sat, 25 Jan 2020 01:06:44 +0000 (04:06 +0300)
chesshog-qrcode/src/test/java/org/hedgecode/chess/qrcode/ChessQRCodeWriterTest.java

index f4a606f..2a5cebc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2019. Developed by Hedgecode.
+ * Copyright (c) 2018-2020. Developed by Hedgecode.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 
 package org.hedgecode.chess.qrcode;
 
+import java.awt.image.RenderedImage;
 import java.io.File;
 
 import javax.imageio.ImageIO;
@@ -75,13 +76,17 @@ public class ChessQRCodeWriterTest extends Assert {
 
         System.out.println(actual);
 
+        File outFile = new File("chessboard.png");
+        RenderedImage image = DiagramBuilder.getInstance().build(
+                actualPosition, "test", "shade"
+        ).getImage();
+
         ImageIO.write(
-                DiagramBuilder.getInstance().build(actualPosition, "test", "shade"),
+                image,
                 "PNG",
-                new File("chessboard.png")
+                outFile
         );
 
-
         System.out.println(
                 Builders.ASCII.builder().build(actualPosition)
         );