Search in sources :

Example 1 with LoaderHelper

use of cn.taketoday.framework.context.config.TestConfigDataBootstrap.LoaderHelper in project today-infrastructure by TAKETODAY.

the class ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests method bootstrapsApplicationContext.

@Test
void bootstrapsApplicationContext() {
    String args = "--context.config.import=classpath:application-bootstrap-registry-integration-tests.properties";
    try (ConfigurableApplicationContext context = application.run(args)) {
        LoaderHelper bean = context.getBean(TestConfigDataBootstrap.LoaderHelper.class);
        assertThat(bean).isNotNull();
        assertThat(bean.getBound()).isEqualTo("igotbound");
        assertThat(bean.getProfileBound()).isEqualTo("igotprofilebound");
        assertThat(bean.getLocation().getResolverHelper().getLocation()).isEqualTo(ConfigDataLocation.valueOf("testbootstrap:test"));
    }
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) LoaderHelper(cn.taketoday.framework.context.config.TestConfigDataBootstrap.LoaderHelper) Test(org.junit.jupiter.api.Test)

Example 2 with LoaderHelper

use of cn.taketoday.framework.context.config.TestConfigDataBootstrap.LoaderHelper in project today-framework by TAKETODAY.

the class ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests method bootstrapsApplicationContext.

@Test
void bootstrapsApplicationContext() {
    String args = "--context.config.import=classpath:application-bootstrap-registry-integration-tests.properties";
    try (ConfigurableApplicationContext context = application.run(args)) {
        LoaderHelper bean = context.getBean(TestConfigDataBootstrap.LoaderHelper.class);
        assertThat(bean).isNotNull();
        assertThat(bean.getBound()).isEqualTo("igotbound");
        assertThat(bean.getProfileBound()).isEqualTo("igotprofilebound");
        assertThat(bean.getLocation().getResolverHelper().getLocation()).isEqualTo(ConfigDataLocation.valueOf("testbootstrap:test"));
    }
}
Also used : ConfigurableApplicationContext(cn.taketoday.context.ConfigurableApplicationContext) LoaderHelper(cn.taketoday.framework.context.config.TestConfigDataBootstrap.LoaderHelper) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurableApplicationContext (cn.taketoday.context.ConfigurableApplicationContext)2 LoaderHelper (cn.taketoday.framework.context.config.TestConfigDataBootstrap.LoaderHelper)2 Test (org.junit.jupiter.api.Test)2