ConditionEvaluationReport class final
The list of @Conditional... checks made while the beans were
registered, with which ones matched and which did not.
Auto-configuration adds or skips beans depending on conditions (is
there already such a bean, is a property set). When a bean you
expected is missing, or one appears that you did not expect, this
report says why. The usual way to see it is to start the application
with --debug (or debug=true in a config file): SpringApplication
then logs it at INFO under the logger
spring_boot_dart.ConditionEvaluationReport after the start, or after
a failed start. Without debug, a failed start logs how to get it.
Read it in code in a test, to check that a starter backs off:
final report = ConditionEvaluationReport.of(context);
// The sources that were left out, with the conditions that failed.
expect(report.negativeMatches.keys, contains('cache'));
Spring (Java):
ConditionEvaluationReport report =
ConditionEvaluationReport.get(context.getBeanFactory());
Constructors
-
ConditionEvaluationReport(Iterable<
ConditionEvaluation> evaluations) -
A report of
evaluations, given in the order they were made. Use ConditionEvaluationReport.of to get the report of a context. - ConditionEvaluationReport.of(ApplicationContext context)
-
The report of the conditions evaluated by
context's last refresh.factory
Properties
-
bySource
→ Map<
String, List< ConditionEvaluation> > -
The outcomes grouped by what the conditions guard: a bean name, a
configuration class (
package:app#CacheConfig) or a@PropertySource. Sources come in the order they were first evaluated; the map is computed on each call.no setter -
evaluations
→ List<
ConditionEvaluation> -
Every outcome, in the order the conditions were evaluated.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
negativeMatches
→ Map<
String, List< ConditionEvaluation> > -
The sources with at least one condition that did not match: what
was left out. Each list holds all the source's outcomes, the matched
ones too.
no setter
-
positiveMatches
→ Map<
String, List< ConditionEvaluation> > -
The sources whose conditions all matched: what was registered
because of them.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
The report in Spring Boot's text layout (
CONDITIONS EVALUATION REPORT, positive matches, then negative matches), as it is logged with--debug.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited