@Test public void classNamesExclusionsAreApplied() { configureExclusions(new String[0], new String[] { VelocityAutoConfiguration.class.getName() }, new String[0]); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 1); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions()) .contains(VelocityAutoConfiguration.class.getName()); }
@Test public void severalPropertyExclusionsAreApplied() { configureExclusions(new String[0], new String[0], new String[] { FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName() }); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions()) .contains(FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName()); }
@Test public void severalPropertyYamlExclusionsAreApplied() { configureExclusions(new String[0], new String[0], new String[0]); this.environment.setProperty("spring.autoconfigure.exclude[0]", FreeMarkerAutoConfiguration.class.getName()); this.environment.setProperty("spring.autoconfigure.exclude[1]", VelocityAutoConfiguration.class.getName()); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions()) .contains(FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName()); }
@Test public void combinedExclusionsAreApplied() { configureExclusions(new String[] { VelocityAutoConfiguration.class.getName() }, new String[] { FreeMarkerAutoConfiguration.class.getName() }, new String[] { ThymeleafAutoConfiguration.class.getName() }); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 3); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions()) .contains(FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName(), ThymeleafAutoConfiguration.class.getName()); }
@Test public void classNamesExclusionsAreApplied() { configureExclusions(new String[0], new String[] { VelocityAutoConfiguration.class.getName() }, new String[0]); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports.length, is(equalTo(getAutoConfigurationClassNames().size() - 1))); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(), contains(VelocityAutoConfiguration.class.getName())); }
@Test public void severalPropertyExclusionsAreApplied() { configureExclusions(new String[0], new String[0], new String[] { FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName() }); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports.length, is(equalTo(getAutoConfigurationClassNames().size() - 2))); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(), containsInAnyOrder(FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName())); }
@Test public void combinedExclusionsAreApplied() { configureExclusions(new String[] { VelocityAutoConfiguration.class.getName() }, new String[] { FreeMarkerAutoConfiguration.class.getName() }, new String[] { ThymeleafAutoConfiguration.class.getName() }); String[] imports = this.importSelector.selectImports(this.annotationMetadata); assertThat(imports.length, is(equalTo(getAutoConfigurationClassNames().size() - 3))); assertThat(ConditionEvaluationReport.get(this.beanFactory).getExclusions(), containsInAnyOrder(FreeMarkerAutoConfiguration.class.getName(), VelocityAutoConfiguration.class.getName(), ThymeleafAutoConfiguration.class.getName())); }