Rename `ContextLoader` to `ApplicationContextTester` and provide
distinct subclasses for standard, web and reactive application contexts.
Context callbacks now return AssertJ compatible contexts, allowing
tests to run directly on context. For example:
context.run((loaded) -> assertThat(loaded).hasBean("foo"));
The returned context can now also represent a context that has failed
to start (meaning that the `loadAndFail` methods are no longer needed):
context.run((loaded) -> assertThat(loaded).hasFailed());
Configuration classes are loaded via the recently introduced
`Configurations` class. This means that the tester no longer needs to
be directly aware of auto-configuration concepts.
See gh-9634
Update `TestPropertyValues` so that it can also be used to update
system properties. Properties are set before the call is made and
restored to their previous value afterwards.
Fixes gh-9792
Add a general purpose `Configurations` class that encapsulates the
sorting and merging rules that are usually apply. The class is
particularly useful in tests where configuration classes often need
to be specified, but an `@Import` or `ImportSelector` cannot be easily
used.
Two `Configurations` subclasses have been initially added. The
`UserConfigurations` class can be used to represent user defined
configuration and the `AutoConfigurations` class can be used to
represent a subset of auto-configurations. Auto configurations are
sorted using the same `@AutoConfiguraionBefore`/`@AutoConfiguraionAfter`
logic as the `@EnableAutoConfiguration` annotation.
Fixes gh-9795
Split the current `ReactiveWebApplicationContext` into two distinct
interfaces to mirror other Spring context interfaces. The
`ReactiveWebApplicationContext` interface now only exposes getters. The
`ConfigurableReactiveWebApplicationContext` exposes setters and extends
from `ConfigurableApplicationContext`.
Fixes gh-9794
PR #7672 Added support for arbitrary common properties.
However, Kafka emits a warning if a producer configuration contains
properties intended only for consumers, and vice versa.
The documentation showed a sample of how to write code to configure
arbitrary properties but this is inconvenient.
Add arbitrary properties to the consumer and procucer configs.
See gh-9775