Skip to content

Micronaut

Stove starts the real Micronaut application and exposes the Micronaut bean graph to bridge().

Open Micronaut + Postgres in wizard

Tiny diff vs Spring The runner is micronaut instead of springBoot, and the port property is micronaut.server.port. Systems and validation DSLs keep the same shape; runner setup and bean registration follow Micronaut conventions.

Setup

dependencies {
    testImplementation(platform("com.trendyol:stove-bom:$stoveVersion"))
    testImplementation("com.trendyol:stove")
    testImplementation("com.trendyol:stove-micronaut")
    testImplementation("com.trendyol:stove-extensions-kotest")  // or -junit
}

Extract run so it returns the started ApplicationContext:

fun main(args: Array<String>) = run(args).let { Unit }

fun run(
  args: Array<String>,
  init: ApplicationContext.() -> Unit = {}
): ApplicationContext {
  val context = ApplicationContext.builder()
    .args(*args)
    .build()
    .also(init)
    .start()

  context.findBean(EmbeddedApplication::class.java).ifPresent { app ->
    if (!app.isRunning) app.start()
  }
  return context
}

Minimal Stove().with { }:

Stove().with {
    httpClient { HttpClientSystemOptions(baseUrl = "http://localhost:8080") }
    micronaut(
        runner = { params -> run(params) },
        withParameters = listOf("micronaut.server.port=8080")
    )
}.run()

What you get

  • ✅ Real Micronaut startup + bean graph
  • ✅ bridge() reaches your DI container
  • ✅ Stove systems compose through the same Stove().with { } registration model

Example