use of cn.taketoday.framework.builder.ApplicationBuilder in project today-infrastructure by TAKETODAY.
the class FailureAnalyzersIntegrationTests method analysisIsPerformed.
@Test
void analysisIsPerformed(CapturedOutput output) {
assertThatExceptionOfType(Exception.class).isThrownBy(() -> new ApplicationBuilder(TestConfiguration.class).type(ApplicationType.NONE_WEB).run());
assertThat(output).contains("APPLICATION FAILED TO START");
}
use of cn.taketoday.framework.builder.ApplicationBuilder in project today-infrastructure by TAKETODAY.
the class ApplicationTests method defaultPropertiesShouldBeMerged.
@Test
void defaultPropertiesShouldBeMerged() {
MockEnvironment environment = new MockEnvironment();
environment.getPropertySources().addFirst(new MapPropertySource(DefaultPropertiesPropertySource.NAME, Collections.singletonMap("bar", "foo")));
Application application = new ApplicationBuilder(ExampleConfig.class).environment(environment).properties("baz=bing").type(ApplicationType.NONE_WEB).build();
this.context = application.run();
assertThat(getEnvironment().getProperty("bar")).isEqualTo("foo");
assertThat(getEnvironment().getProperty("baz")).isEqualTo("bing");
}
use of cn.taketoday.framework.builder.ApplicationBuilder in project today-framework by TAKETODAY.
the class FailureAnalyzersIntegrationTests method analysisIsPerformed.
@Test
void analysisIsPerformed(CapturedOutput output) {
assertThatExceptionOfType(Exception.class).isThrownBy(() -> new ApplicationBuilder(TestConfiguration.class).type(ApplicationType.NONE_WEB).run());
assertThat(output).contains("APPLICATION FAILED TO START");
}
use of cn.taketoday.framework.builder.ApplicationBuilder in project today-framework by TAKETODAY.
the class ApplicationTests method defaultPropertiesShouldBeMerged.
@Test
void defaultPropertiesShouldBeMerged() {
MockEnvironment environment = new MockEnvironment();
environment.getPropertySources().addFirst(new MapPropertySource(DefaultPropertiesPropertySource.NAME, Collections.singletonMap("bar", "foo")));
Application application = new ApplicationBuilder(ExampleConfig.class).environment(environment).properties("baz=bing").type(ApplicationType.NONE_WEB).build();
this.context = application.run();
assertThat(getEnvironment().getProperty("bar")).isEqualTo("foo");
assertThat(getEnvironment().getProperty("baz")).isEqualTo("bing");
}
Aggregations