package bench.reachability; import java.io.*; import java.util.*; import java.util.Base64; // Simple hand-rolled test harness (no external deps) using Java assertions. public class AppTest { private static String serialize(Object obj) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(obj); oos.close(); return Base64.getEncoder().encodeToString(bos.toByteArray()); } public static void main(String[] args) throws Exception { String payload = serialize("hello"); Map body = Map.of("payload", payload); var res = App.handleRequest(body); assert res.status() == 200 : "status"; assert res.body().equals("hello") : "body"; // Emit a simple marker file for trace/coverage stand-ins File outDir = new File("outputs"); outDir.mkdirs(); try (FileWriter fw = new FileWriter(new File(outDir, "SINK_REACHED"))) { fw.write("true"); } } }