Search in sources :

Example 1 with ConfigurablePropertyResolver

use of cn.taketoday.core.env.ConfigurablePropertyResolver in project today-framework by TAKETODAY.

the class AbstractApplicationEnvironmentTests method propertyResolverIsOptimizedForConfigurationProperties.

@Test
void propertyResolverIsOptimizedForConfigurationProperties() {
    StandardEnvironment environment = createEnvironment();
    ConfigurablePropertyResolver expected = ConfigurationPropertySources.createPropertyResolver(new PropertySources());
    Object propertyResolver = BeanWrapper.forDirectFieldAccess(environment).getPropertyValue("propertyResolver");
    assertThat(propertyResolver).isInstanceOf(expected.getClass());
}
Also used : ConfigurationPropertySources(cn.taketoday.context.properties.source.ConfigurationPropertySources) PropertySources(cn.taketoday.core.env.PropertySources) ConfigurablePropertyResolver(cn.taketoday.core.env.ConfigurablePropertyResolver) StandardEnvironment(cn.taketoday.core.env.StandardEnvironment) Test(org.junit.jupiter.api.Test)

Example 2 with ConfigurablePropertyResolver

use of cn.taketoday.core.env.ConfigurablePropertyResolver in project today-infrastructure by TAKETODAY.

the class AbstractApplicationEnvironmentTests method propertyResolverIsOptimizedForConfigurationProperties.

@Test
void propertyResolverIsOptimizedForConfigurationProperties() {
    StandardEnvironment environment = createEnvironment();
    ConfigurablePropertyResolver expected = ConfigurationPropertySources.createPropertyResolver(new PropertySources());
    Object propertyResolver = BeanWrapper.forDirectFieldAccess(environment).getPropertyValue("propertyResolver");
    assertThat(propertyResolver).isInstanceOf(expected.getClass());
}
Also used : ConfigurationPropertySources(cn.taketoday.context.properties.source.ConfigurationPropertySources) PropertySources(cn.taketoday.core.env.PropertySources) ConfigurablePropertyResolver(cn.taketoday.core.env.ConfigurablePropertyResolver) StandardEnvironment(cn.taketoday.core.env.StandardEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurationPropertySources (cn.taketoday.context.properties.source.ConfigurationPropertySources)2 ConfigurablePropertyResolver (cn.taketoday.core.env.ConfigurablePropertyResolver)2 PropertySources (cn.taketoday.core.env.PropertySources)2 StandardEnvironment (cn.taketoday.core.env.StandardEnvironment)2 Test (org.junit.jupiter.api.Test)2