### Question:
SpringBootAdminClientEnabledCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata annotatedTypeMetadata) { ClientProperties clientProperties = getClientProperties(context); if (!clientProperties.isEnabled()) { return ConditionOutcome .noMatch("Spring Boot Client is disabled, because 'spring.boot.admin.client.enabled' is false."); } if (clientProperties.getUrl().length == 0) { return ConditionOutcome .noMatch("Spring Boot Client is disabled, because 'spring.boot.admin.client.url' is empty."); } return ConditionOutcome.match(); }  @Override ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata annotatedTypeMetadata);  }### Answer:
@Test public void test_emptyUrl_enabled() { MockEnvironment environment = new MockEnvironment(); BDDMockito.given(conditionContext.getEnvironment()).willReturn(environment); assertThat(condition.getMatchOutcome(conditionContext, annotatedTypeMetadata).isMatch()).isFalse(); }
@Test public void test_emptyUrl_disabled() { MockEnvironment environment = new MockEnvironment(); environment.setProperty("spring.boot.admin.client.enabled", "false"); BDDMockito.given(conditionContext.getEnvironment()).willReturn(environment); assertThat(condition.getMatchOutcome(conditionContext, annotatedTypeMetadata).isMatch()).isFalse(); }
@Test public void test_nonEmptyUrl_disabled() { MockEnvironment environment = new MockEnvironment(); environment.setProperty("spring.boot.admin.client.enabled", "false"); environment.setProperty("spring.boot.admin.client.url", "http: BDDMockito.given(conditionContext.getEnvironment()).willReturn(environment); assertThat(condition.getMatchOutcome(conditionContext, annotatedTypeMetadata).isMatch()).isFalse(); }
@Test public void test_nonEmptyUrl_enabled() { MockEnvironment environment = new MockEnvironment(); environment.setProperty("spring.boot.admin.client.url", "http: BDDMockito.given(conditionContext.getEnvironment()).willReturn(environment); assertThat(condition.getMatchOutcome(conditionContext, annotatedTypeMetadata).isMatch()).isTrue(); }