Skip to content

Add real Spring Boot integration test fixtures (SB3 + SB4) via java-test-applications #1357

Description

@stokpop

Problem

java-buildpack has no real Spring Boot fixture — every current integration fixture is a fake com.sun.net.httpserver.HttpServer stub with a fake spring-boot-*.jar used only to trip detection. So no integration test can exercise actual Spring Boot runtime behavior (active profiles, VCAP_SERVICES → property mapping, autoconfiguration, framework injection, …). This blocks meaningful end-to-end coverage of the Java frameworks.

Proposal

Stand up genuine Spring Boot fixtures — both SB3 and SB4 — reusing cloudfoundry/java-test-applications instead of committing built jars:

  • java-test-applications: modernize java-main-application + core + spring-common to SB3 and SB4 variants (currently Spring Boot 2.6.7 / JDK 8), expose small observability endpoints (e.g. /active-profilesEnvironment#getActiveProfiles(), extend the existing /environment-variables), and publish the built jars as a GitHub release.
  • java-buildpack: download the pinned released jars in a BeforeSuite, deploy via switchblade with bound services, and assert on the app's HTTP responses.

Fat-jar wiring is compatible: the buildpack unwraps Spring Boot and launches -cp ${CLASSPATH}:$HOME/BOOT-INF/lib/* (not java -jar), so buildpack-injected jars and their spring.factories load normally.

First use case: verify java-cfenv activates the cloud profile (SB3 → java-cfenv 3.x, SB4 → 4.0.0) — closes the runtime gap left by #1352. The same fixtures then enable further SB feature tests (service property mapping, autoconfiguration, agent/framework behavior).

Full design / plan: https://gist.github.com/stokpop/c26a89daccf95a821707321627890947

Notes

  • Main cost: modernizing java-test-applications (SB 2.6.7 → 3.x/4.1, JDK 8 → 17/21) and adding a publish workflow (it publishes nothing today).
  • Also fixes the dead reference at src/integration/frameworks_test.go:448 (points at a non-existent java-main-application.jar → 404).

Refs #1349, #1352.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions