Kora Testing Junit Java

In-process JUnit 5 tests for Java Kora 2.0 services — io.koraframework:test-junit5 with @KoraAppTest, @TestComponent, KoraAppTestConfigModifier/KoraConfigModification, KoraAppTestGraphModifier/KoraGraphModification, KoraAppGraph, Mockito @Mock/@Spy plus @MockitoStrictness, the @KoraApp TestApplication submodule pattern behind -Akora.app.submodule.enabled=true, and Testcontainers for PostgreSQL/Kafka. Needs testAnnotationProcessor "io.koraframework:annotation-processors". Contracts are synchronous, so reactive/CompletionStage test shapes are gone, and HOCON embedded in KoraConfigModification.ofString must use 2.0 keys (jdbc, httpServer.port). Use when writing a Kora 2.0 Java test, mocking a component inside the graph, overriding test config, or starting a real database/broker. For Kotlin see kora-testing-junit-kotlin; for the packaged image see kora-testing-blackbox.

kora-projects 1a9967d 15 files · 142.9 KB Updated

File contents

kora-projects/kora-skills/tree/main/plugins/kora-v2/skills/kora-testing-junit-java commit 1a9967d709

Frequently asked questions

npx skillmds@latest add kora-projects/kora-testing-junit-java-2