use of org.springframework.boot.builder.SpringApplicationBuilder in project ratauth by alfa-laboratory.
the class RatAuthServerTest method registerAndRefresh.
private void registerAndRefresh(Class<?> configClass, String... properties) {
HashMap<String, Object> mergedPropsMap = mergePropertiesWithDefault(properties);
context = new SpringApplicationBuilder(configClass).web(false).properties(mergedPropsMap).profiles("local").run();
}
use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-cloud-gcp by spring-cloud.
the class SecretManagerBootstrapConfigurationTests method configurationDisabled.
@Test
public void configurationDisabled() {
SpringApplicationBuilder disabledConfigurationApp = new SpringApplicationBuilder(TestBootstrapConfiguration.class, GcpSecretManagerBootstrapConfiguration.class).properties("spring.cloud.gcp.secretmanager.project-id=" + PROJECT_NAME).properties("spring.cloud.gcp.secretmanager.enabled=false").web(WebApplicationType.NONE);
try (ConfigurableApplicationContext c = disabledConfigurationApp.run()) {
String secret = c.getEnvironment().getProperty("sm://my-secret");
assertThat(secret).isEqualTo(null);
}
}
use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-cloud-gcp by spring-cloud.
the class GcpConfigIntegrationTests method testConfiguration.
@Test
public void testConfiguration() {
this.context = new SpringApplicationBuilder().sources(GcpContextAutoConfiguration.class, GcpConfigBootstrapConfiguration.class).web(WebApplicationType.NONE).properties("spring.cloud.gcp.config.enabled=true", "spring.application.name=myapp", "spring.profiles.active=dontexist,prod").run();
assertThat(this.context.getEnvironment().getProperty("myapp.queue-size")).isEqualTo("200");
assertThat(this.context.getEnvironment().getProperty("myapp.feature-x-enabled")).isEqualTo("true");
}
use of org.springframework.boot.builder.SpringApplicationBuilder in project proxyee-down by monkeyWie.
the class DownApplication method initRest.
private void initRest() {
// init rest server config
HttpDownRestCallback.setCallback(new HttpDownAppCallback());
RestWebServerFactoryCustomizer.init(null);
ServerConfigInfo serverConfigInfo = ConfigContent.getInstance().get();
serverConfigInfo.setPort(REST_PORT);
if (StringUtils.isEmpty(serverConfigInfo.getFilePath())) {
serverConfigInfo.setFilePath(System.getProperty("user.home") + File.separator + "Downloads");
}
new SpringApplicationBuilder(DownRestServer.class).headless(false).build().run();
}
use of org.springframework.boot.builder.SpringApplicationBuilder in project hub-detect by blackducksoftware.
the class Application method main.
public static void main(final String[] args) {
SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
builder.logStartupInfo(false);
builder.run(args);
}
Aggregations