use of cn.taketoday.framework.Application in project today-infrastructure by TAKETODAY.
the class ConfigurationPropertiesTests method loadWhenEnvironmentPrefixSetShouldBind.
@Test
void loadWhenEnvironmentPrefixSetShouldBind() {
PropertySources sources = this.context.getEnvironment().getPropertySources();
sources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, new SystemEnvironmentPropertySource(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, Collections.singletonMap("MY_SPRING_FOO_NAME", "Jane")));
Application application = new Application(PrefixConfiguration.class);
application.setApplicationContextFactory((webApplicationType) -> ConfigurationPropertiesTests.this.context);
application.setEnvironmentPrefix("my");
application.setEnvironment(this.context.getEnvironment());
application.run();
BasicProperties bean = this.context.getBean(BasicProperties.class);
assertThat(bean.name).isEqualTo("Jane");
}
use of cn.taketoday.framework.Application in project today-infrastructure by TAKETODAY.
the class ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests method setup.
@BeforeEach
void setup() {
this.application = new Application(Config.class);
this.application.setApplicationType(ApplicationType.NONE_WEB);
}
use of cn.taketoday.framework.Application in project today-infrastructure by TAKETODAY.
the class ConfigDataEnvironmentPostProcessorIntegrationTests method setup.
@BeforeEach
void setup() {
this.application = new Application(Config.class);
this.application.setApplicationType(ApplicationType.NONE_WEB);
}
use of cn.taketoday.framework.Application in project today-infrastructure by TAKETODAY.
the class ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests method setup.
@BeforeEach
void setup() {
this.application = new Application(Config.class);
this.application.setApplicationType(ApplicationType.NONE_WEB);
}
use of cn.taketoday.framework.Application in project today-framework by TAKETODAY.
the class ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests method setup.
@BeforeEach
void setup() {
this.application = new Application(Config.class);
this.application.setApplicationType(ApplicationType.NONE_WEB);
}
Aggregations