package com; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class TestConstant { public static final String TARGET_IMAGE_URL = "https://www.opsky.com.cn/upload/20211224/KXfgvm2MFRAXKbPu5LK.png"; public static final String TARGET_IMAGE_BASE64; static { try { Path path = Paths.get("src/test/resources/image_base64.txt"); TARGET_IMAGE_BASE64 = "data:image/png;base64," + new String(Files.readAllBytes(path), StandardCharsets.UTF_8).trim(); } catch (Exception e) { throw new RuntimeException("Failed to load image_base64.txt", e); } } }