Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Findings Ledger CI / build-test (push) Has been cancelled
Findings Ledger CI / migration-validation (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
cryptopro-linux-csp / build-and-test (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
sm-remote-ci / build-and-test (push) Has been cancelled
Findings Ledger CI / generate-manifest (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
30 lines
1017 B
Java
30 lines
1017 B
Java
package bench.reachability.micronaut;
|
|
|
|
import java.io.*;
|
|
import java.util.*;
|
|
import java.util.Base64;
|
|
|
|
// Simple assertion-based oracle (JUnit-free for offline determinism)
|
|
public class ControllerTest {
|
|
private static String serialize(Object obj) throws IOException {
|
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
|
|
oos.writeObject(obj);
|
|
}
|
|
return Base64.getEncoder().encodeToString(bos.toByteArray());
|
|
}
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
Map<String, String> body = Map.of("payload", serialize("micronaut"));
|
|
var res = Controller.handleUpload(body);
|
|
assert res.status() == 200 : "status";
|
|
assert res.body().equals("micronaut") : "body";
|
|
|
|
File outDir = new File("outputs");
|
|
outDir.mkdirs();
|
|
try (FileWriter fw = new FileWriter(new File(outDir, "SINK_REACHED"))) {
|
|
fw.write("true");
|
|
}
|
|
}
|
|
}
|