Search in sources :

Example 1 with ContextConditionEvaluation

use of org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint.ContextConditionEvaluation in project spring-boot by spring-projects.

the class ConditionsReportEndpointTests method invoke.

@Test
void invoke() {
    new ApplicationContextRunner().withUserConfiguration(Config.class).run((context) -> {
        ContextConditionEvaluation report = context.getBean(ConditionsReportEndpoint.class).applicationConditionEvaluation().getContexts().get(context.getId());
        assertThat(report.getPositiveMatches()).isEmpty();
        assertThat(report.getNegativeMatches()).containsKey("a");
        assertThat(report.getUnconditionalClasses()).contains("b");
        assertThat(report.getExclusions()).contains("com.foo.Bar");
    });
}
Also used : ApplicationContextRunner(org.springframework.boot.test.context.runner.ApplicationContextRunner) ContextConditionEvaluation(org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint.ContextConditionEvaluation) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ContextConditionEvaluation (org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint.ContextConditionEvaluation)1 ApplicationContextRunner (org.springframework.boot.test.context.runner.ApplicationContextRunner)1