Optional JUnit 5 bridge for the Observer Java SDK.
This module exists for teams that already have JUnit 5 test classes and want to export them through Observer without rewriting everything into the core Observer.* DSL on day one.
The bridge is intentionally narrow and deterministic:
- it collects ordinary zero-argument
@Testmethods - it runs
@BeforeEachand@AfterEacharound each exported method target - it derives exported ids from
fully.qualified.ClassName#methodName - it only changes the exported id when you opt into
@ObserverId - it treats
@DisplayNameas authored title sugar rather than the exported target contract
That gives Java teams a natural adoption path while keeping Observer's deterministic boundary explicit.
import io.frogfish.observer.junit5.ObserverJunit5;
var tests = ObserverJunit5.collectTests(LedgerTests.class);
hostMain("java", tests, args);import io.frogfish.observer.junit5.ObserverId;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
final class LedgerTests {
@Test
@DisplayName("smoke")
@ObserverId("app::smoke")
void smoke() {
System.out.print("consumer ok\n");
}
}pom.xml: publish-ready Maven metadata for the bridge artifactbuild.gradle: publish-ready Gradle metadata for the bridge artifactMakefile: repo-local compile and self-test flow using plainjavac
Inside this repository the bridge is validated without installing JUnit itself.
The self-test compiles tiny annotation stubs under the real org.junit.jupiter.api package names and exercises the bridge behavior with plain javac.
Run it with:
cd lib/java-junit5
make testSee:
../../examples/java-consumer-maven/for a Maven-shaped core Java consumer../../examples/java-consumer-gradle/for a Gradle-shaped Java consumer using this JUnit 5 bridge