The GitHub Actions job "Code Style" on grails-core.git/deps/micronaut-5.0.0 has 
succeeded.
Run started by GitHub user jamesfredley (triggered by jamesfredley).

Head commit for run:
228f9a52ce58e0a4f675d60d9ef1e7e209025001 / James Fredley 
<[email protected]>
refactor(deps): Remove Micronaut HTTP client from grails-data-graphql tests

The `GraphQLSpec` test trait in `grails-data-graphql/plugin` shipped a
Micronaut RxJava2 HTTP client 
(`io.micronaut.rxjava2:micronaut-rxjava2-http-client`)
purely to exercise the GraphQL controller from integration tests. Spring
Boot 4 already provides everything that trait needs via Spring's
`RestClient` (org.springframework.web.client.RestClient) - there is no
reason for a Grails GraphQL plugin to depend on the Micronaut HTTP stack,
and `io.micronaut.rxjava2` has not been ported to Micronaut 5 anyway.

Replace the Micronaut HTTP client with Spring `RestClient`:

- `GraphQLSpec.groovy` is rewritten to use `RestClient.builder()` with a
  single `StringHttpMessageConverter` (configured to accept all media
  types). JSON encoding/decoding is handled by Groovy's `JsonOutput` and
  `JsonSlurper` so the trait does not pull a Jackson or Gson runtime
  onto the consuming apps - the graphql test apps use `grails-views-gson`
  but do not actually ship the Gson library, and Grails 8 does not ship
  Jackson on the default classpath either.
- Helper return type changes from `io.micronaut.http.HttpResponse<Map>`
  to `org.springframework.http.ResponseEntity<Map>`. Spring's
  `ResponseEntity.getBody()` returns `T` directly (not `Optional<T>`),
  so the 109 `resp.body()` call sites collapse to `resp.body` (Groovy
  property access) across 17 integration test specs.
- The two-arg `graphql(String, Class<T>)` overload survives but is now
  String-only (the one caller, `InheritanceIntegrationSpec`, asserts on
  the raw JSON string body). The single remaining `resp.getBody().get()`
  call site (from Micronaut's `Optional`-returning getter) becomes
  `resp.getBody()`.

The unused-after-removal version pins are dropped from `gradle.properties`:

- `micronautRxjava2Version=2.9.0` - was the rxjava2 client pin.
- `micronautSerdeJacksonVersion=2.16.2` - was only there as the JSON
  mapper for the rxjava2 client. No production code uses
  `@Serdeable` or any `io.micronaut.serde.*` API; confirmed via grep
  across `grails-data-graphql/` and `grails-test-examples/graphql/`.

Each of the 4 graphql test apps loses both `implementation` lines (rxjava2
+ serde-jackson) - they brought no Spring Boot-side value once the Mn
HTTP client is gone.

Verified locally on JDK 21:

```
./gradlew validateDependencyVersions \
    :grails-test-examples-graphql-grails-test-app:integrationTest \
    :grails-test-examples-graphql-grails-docs-app:integrationTest \
    :grails-test-examples-graphql-grails-multi-datastore-app:integrationTest \
    :grails-test-examples-graphql-grails-tenant-app:integrationTest \
    -PskipMicronautProjects
# BUILD SUCCESSFUL - all integration tests pass across all 4 apps
```

Side note: this closes the long-standing "out-of-band Micronaut pin"
comment in `gradle.properties`: nothing in grails-core now depends on
Micronaut artifacts outside the Grails-Micronaut "island" managed by
`grails-micronaut-bom`.

Assisted-by: claude-code:claude-opus-4-7

Report URL: https://github.com/apache/grails-core/actions/runs/26306336477

With regards,
GitHub Actions via GitBox

Reply via email to