@Test(expected = NullPointerException.class) public void should_not_generate_svg_when_qrcode_is_nul() { svgConverter.generateSvg(null, "black", "content"); }
public String generateSvg(QRCode qrCode, String color, String content) { Objects.requireNonNull(qrCode); return String.format( "<svg viewBox=\"0 0 %d %d\" xmlns=\"http: "<path stroke=\"%s\" d=\"%s\"/>" + "</svg>", qrCode.getMatrix().getWidth(), qrCode.getMatrix().getHeight(), color==null ? "black" : color, content); }
SvgConverter { public String generateSvg(QRCode qrCode, String color, String content) { Objects.requireNonNull(qrCode); return String.format( "<svg viewBox=\"0 0 %d %d\" xmlns=\"http: "<path stroke=\"%s\" d=\"%s\"/>" + "</svg>", qrCode.getMatrix().getWidth(), qrCode.getMatrix().getHeight(), color==null ? "black" : color, content); } }
SvgConverter { public String generateSvg(QRCode qrCode, String color, String content) { Objects.requireNonNull(qrCode); return String.format( "<svg viewBox=\"0 0 %d %d\" xmlns=\"http: "<path stroke=\"%s\" d=\"%s\"/>" + "</svg>", qrCode.getMatrix().getWidth(), qrCode.getMatrix().getHeight(), color==null ? "black" : color, content); }  }
SvgConverter { public String generateSvg(QRCode qrCode, String color, String content) { Objects.requireNonNull(qrCode); return String.format( "<svg viewBox=\"0 0 %d %d\" xmlns=\"http: "<path stroke=\"%s\" d=\"%s\"/>" + "</svg>", qrCode.getMatrix().getWidth(), qrCode.getMatrix().getHeight(), color==null ? "black" : color, content); }  List<SvgPath> parseQRCodeMatrix(QRCode qrcode); String generatePathSvg(QRCode qrCode); String generateSvg(QRCode qrCode, String color, String content); }
SvgConverter { public String generateSvg(QRCode qrCode, String color, String content) { Objects.requireNonNull(qrCode); return String.format( "<svg viewBox=\"0 0 %d %d\" xmlns=\"http: "<path stroke=\"%s\" d=\"%s\"/>" + "</svg>", qrCode.getMatrix().getWidth(), qrCode.getMatrix().getHeight(), color==null ? "black" : color, content); }  List<SvgPath> parseQRCodeMatrix(QRCode qrcode); String generatePathSvg(QRCode qrCode); String generateSvg(QRCode qrCode, String color, String content);  }