@Test public void testGetMatchOutcome() { VelocityToolsBasePackagesCondition condition = new VelocityToolsBasePackagesCondition(); MockEnvironment environment = new MockEnvironment(); MockConditionContext conditionContext = new MockConditionContext(); conditionContext.setEnvironment(environment); ConditionOutcome conditionOutcome = condition.getMatchOutcome(conditionContext, null); Assert.assertFalse(conditionOutcome.isMatch()); environment.setProperty("spring.velocity.tools-base-packages", "com.alibaba.boot.velocity.tools"); conditionOutcome = condition.getMatchOutcome(conditionContext, null); Assert.assertTrue(conditionOutcome.isMatch()); }
@Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String toolsBasePackages = environment.getProperty(VELOCITY_TOOLS_BASE_PACKAGES_PROPERTY_NAME); if (!StringUtils.hasText(toolsBasePackages)) { return ConditionOutcome.noMatch("Velocity Tools scanning is disabled , since its base packages is empty !"); } return ConditionOutcome.match(); }
VelocityToolsBasePackagesCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String toolsBasePackages = environment.getProperty(VELOCITY_TOOLS_BASE_PACKAGES_PROPERTY_NAME); if (!StringUtils.hasText(toolsBasePackages)) { return ConditionOutcome.noMatch("Velocity Tools scanning is disabled , since its base packages is empty !"); } return ConditionOutcome.match(); } }
VelocityToolsBasePackagesCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String toolsBasePackages = environment.getProperty(VELOCITY_TOOLS_BASE_PACKAGES_PROPERTY_NAME); if (!StringUtils.hasText(toolsBasePackages)) { return ConditionOutcome.noMatch("Velocity Tools scanning is disabled , since its base packages is empty !"); } return ConditionOutcome.match(); }  }
VelocityToolsBasePackagesCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String toolsBasePackages = environment.getProperty(VELOCITY_TOOLS_BASE_PACKAGES_PROPERTY_NAME); if (!StringUtils.hasText(toolsBasePackages)) { return ConditionOutcome.noMatch("Velocity Tools scanning is disabled , since its base packages is empty !"); } return ConditionOutcome.match(); }  @Override ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata); }
VelocityToolsBasePackagesCondition extends SpringBootCondition { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String toolsBasePackages = environment.getProperty(VELOCITY_TOOLS_BASE_PACKAGES_PROPERTY_NAME); if (!StringUtils.hasText(toolsBasePackages)) { return ConditionOutcome.noMatch("Velocity Tools scanning is disabled , since its base packages is empty !"); } return ConditionOutcome.match(); }  @Override ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata);  }