Search in sources :

Example 1 with ConditionContext

use of org.springframework.context.annotation.ConditionContext in project spring-boot by spring-projects.

the class LocalDebugPortAvailableConditionTests method getOutcome.

private ConditionOutcome getOutcome() {
    MockEnvironment environment = new MockEnvironment();
    EnvironmentTestUtils.addEnvironment(environment, "spring.devtools.remote.debug.local-port:" + this.port);
    ConditionContext context = mock(ConditionContext.class);
    given(context.getEnvironment()).willReturn(environment);
    ConditionOutcome outcome = this.condition.getMatchOutcome(context, null);
    return outcome;
}
Also used : ConditionContext(org.springframework.context.annotation.ConditionContext) MockEnvironment(org.springframework.mock.env.MockEnvironment) ConditionOutcome(org.springframework.boot.autoconfigure.condition.ConditionOutcome)

Example 2 with ConditionContext

use of org.springframework.context.annotation.ConditionContext in project spring-boot-admin by codecentric.

the class SpringBootAdminClientEnabledConditionTest method setUp.

@Before
public void setUp() {
    condition = new SpringBootAdminClientEnabledCondition();
    annotatedTypeMetadata = mock(AnnotatedTypeMetadata.class);
    conditionContext = mock(ConditionContext.class);
}
Also used : ConditionContext(org.springframework.context.annotation.ConditionContext) SpringBootAdminClientEnabledCondition(de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition) AnnotatedTypeMetadata(org.springframework.core.type.AnnotatedTypeMetadata) Before(org.junit.Before)

Aggregations

ConditionContext (org.springframework.context.annotation.ConditionContext)2 SpringBootAdminClientEnabledCondition (de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition)1 Before (org.junit.Before)1 ConditionOutcome (org.springframework.boot.autoconfigure.condition.ConditionOutcome)1 AnnotatedTypeMetadata (org.springframework.core.type.AnnotatedTypeMetadata)1 MockEnvironment (org.springframework.mock.env.MockEnvironment)1