Skip to content

spring-kotlin docker-backed integration test #70

Description

@rossdanderson

Parent

#65

What to build

Give examples/spring-kotlin a docker-backed integration test that proves the Spring starter serves
data end-to-end through a live Liberator, modelled on the shape of application-apis'
CalendarAdapterIntegrationTest (Liberator Testcontainer → real adapter against the mapped DataSource
port → StreamLink client assertions via Turbine).

  • Add an integrationTest JvmTestSuite depending on datasourcex-kotest, the Kotest runner, and
    Turbine. It is not wired into check, and Kover instrumentation is disabled for it — so CI
    (no Docker registry) never runs it; developers run :spring-kotlin:integrationTest on demand.

  • No production change to the example. The adapter is pointed at the container's mapped DataSource
    port purely by overriding a startup property. The following shape came from the prototype in spring-kotlin docker-backed integrationTest design #64
    and encodes the key decision (start-the-real-adapter-via-config, then assert through a StreamLink
    client):

    val liberator = install(LiberatorContainerExtension())
    val ctx = SpringApplicationBuilder(SpringKotlinApplication::class.java)
        .properties("caplin.datasource.managed.peer.outgoing=" +
            "ws://${liberator.containerState.host}:${liberator.dataSourcePort}")
        .run()
    // liberator.connect("alice").getSubject<Payload>(Subject("public","stream","foo","42"))…
  • Assert: the public Payload stream (first item version 0, parameter1="foo", parameter2=42,
    non-null uuid; next item version 1); the public container's initial Bulk of 10 rows; and the
    USER_ID / persistent-session token injection reaching the payload. Proving USER_ID overrides the
    path requires a Liberator object-map (%u) override supplied via DefaultContainerConfig(adapterConfig = …),
    and the session assertion requires establishing a persistent session — validate these while building.

Acceptance criteria

  • examples/spring-kotlin has an integrationTest source set depending on datasourcex-kotest.
  • The suite is excluded from check and from Kover; ./gradlew check does not start a container.
  • The test starts the real spring-kotlin adapter against the container's mapped port via configuration only (no production-code change).
  • It asserts the public Payload stream and the container's 10-row bulk end-to-end.
  • It asserts the injected USER_ID and persistent-session id thread into the payload.
  • :spring-kotlin:integrationTest passes locally against a real Liberator.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentTriaged and ready for an agent to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions