@Bean @ConditionalOnMissingBean(name = "velocityViewResolver") @ConditionalOnProperty(name = "spring.velocity.enabled", matchIfMissing = true) public EmbeddedVelocityViewResolver velocityViewResolver() { EmbeddedVelocityViewResolver resolver = new EmbeddedVelocityViewResolver(); this.properties.applyToViewResolver(resolver); return resolver; }
@Test public void usesEmbeddedVelocityViewResolver() { registerAndRefreshContext("spring.velocity.toolbox:/toolbox.xml"); VelocityViewResolver resolver = this.context.getBean(VelocityViewResolver.class); assertThat(resolver).isInstanceOf(EmbeddedVelocityViewResolver.class); }
@Test public void usesEmbeddedVelocityViewResolver() { registerAndRefreshContext("spring.velocity.toolbox:/toolbox.xml"); VelocityViewResolver resolver = this.context.getBean(VelocityViewResolver.class); assertThat(resolver, instanceOf(EmbeddedVelocityViewResolver.class)); }