This annotation is read by ObservabilityContextCustomizerFactory, which
then sets test properties depending on the annotation attributes.
@AutoConfigureMetrics is deprecated, to support backwards compatability
it's now meta-annotated with @AutoConfigureObservability
See gh-31308
This commit removes auto-configuration and dependency management
for Flapdoodle embedded MongoDB in favor of the Spring Boot support
provided by Flapdoodle.
Closes gh-30863
Prior to this commit, the auto-configured
`ExecutionGraphQlServiceTester` would use a default Jackson
`ObjectMapper` provided by the builder for its JSON
serialization/deserialization needs. Other testers, like the
`HttpGraphQlTester` are based on auto-configured components which
already use the auto-configured `ObjectMapper`.
This commit uses the newly introduced `encoder(Encoder<?>)` and
`decoder(Decoder<?>)` builder methods to configure custom JSON codecs
honoring the application configuration.
Closes gh-30646
- Moved from 'management.metrics.export.<product>' to
'management.<product>.metrics.export'
- The default enabled property moved from 'management.metrics.export.defaults.enabled'
to 'management.defaults.metrics.export.enabled'
Closes gh-30381
This commit adapts to the latest Spring GraphQL changes, renaming
`GraphQlService` to `ExecutionGraphQlService` as well as the
`WebInterceptor` contract to `WebGraphQlHandlerInterceptor`.
See spring-projects/spring-graphql#332
Prior to this commit, `@GraphQlTest` slice tests would only consider
JsonComponent, RuntimeWiringConfigurer, Converter and
GenericConverter beans. But DataFetcherExceptionResolver,
Instrumentation and GraphQlSourceBuilderCustomizer are used in
setting up the GraphQL source.
This commit ensures that the `GraphQlTypeExcludeFilter` considers
those bean types.
Closes gh-30078
This commit switches to 1.0.0-SNAPSHOT for Spring GraphQL, before its
upcoming 1.0.0-M6 version.
This commit adapts to the changes introduced in
spring-projects/spring-graphql#317 : now that `GraphQlClient` has been
introduced, `GraphQlTester` has been aligned with the new
infrastructure. The `@GraphQlTest` and `@SpringBootTest` testing support
is now using different variants for each.
All samples have been updated to use the proper GraphQL terminology, see
and spring-projects/spring-graphql#310 .
See gh-29637
Implements a new AutoConfigurationLoader, which loads
auto-configurations from a file in META-INF/spring-boot.
Adapts the AutoConfigurationImportSelector to use the new loader.
Adapts the ImportAutoConfigurationImportSelector to use the new loader.
Adapts the metadata plugin in the build to additionally load the
auto-configurations from the new file.
Updates the documentation for auto-configurations and test slices.
Closes gh-29872
This commit makes @ConstructorBinding optional for a type
that has a single parameterized constructor. An @Autowired annotation
on any of the constructors indicates that the type should not be constructor
bound.
Since @ConstructorBinding is now deduced for a single parameterized constructor,
the annotation is no longer needed at the type level.
Closes gh-23216
H2 2.x contains several important changes such as moving the primary key
generation mechanism to a sequence-based identifier. This commit fixes
a number of tests that were failing.
Closes gh-29651
Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>
This commit adds the `@GraphQlTest` annotation which brings a new type
of sliced test for GraphQL applications. This considers all the required
infrastructure brought by `@AutoConfigureGraphQl`, but also brings
application components like `@Controller` beans and
`RuntimeWiringConfigurer`.
With this type of test, we'll only initialize a minimal setup for
testing a set of Controllers, without involving any transport-related
component.
See gh-29140
This commit adds the required infrastructure to auto-configure a
`GraphQlTester` or `WebGraphQlTester` in Spring Boot tests.
Specific annotations like `AutoConfigureGraphQlTester` and
`AutoConfigureWebGraphQlTester` will contribute pre-configured beans for
testing a GraphQL with the tester.
This also ships a `ContextCustomize` for contributing a `GraphQlTester`
in the case of a full `@SpringBootTest` integration test against a live
server.
See gh-29140
This commit adds the `@AutoConfigureGraphQl` test annotation. It can be
used to import the relevant auto-configurations when testing a GraphQL
application.
Currently, it will get the main `GraphQlAutoConfiguration`, but also
what's required for configuring codecs and validation support.
See gh-29140
This commit makes it clearer that, when using
@AutoConfigureTestEntityManager outside of @DataJpaTest, any tests using
the test entity manager must be @Transactional.
See gh-28086
As of Spring Framework 5.3, `WebTestClient` can now be configured on top
of `MockMvc` for testing Spring MVC applications in a mock environment.
Prior to this commit, `WebTestClient` would be already configured for
WebFlux mock setups with `@AutoConfigureWebTestClient` or live servers
(for both MVC and WebFlux apps).
This commit enhances the `@AutoConfigureWebMvc` support so that a
`WebTestClient` instance is auto-configured if the spring-webflux
dependency is present on the classpath.
Closes gh-23067
Previously DataRedisTest-annotated test could not use reactive
operations as RedisReactiveAutoConfiguration is not considered. This
commit includes this auto-configuration and adds a test to exercise this
scenario.
Closes gh-26319