use of org.springframework.core.env.CommandLinePropertySource in project spring-boot by spring-projects.
the class SpringApplicationTests method commandLinePropertySource.
@Test
public void commandLinePropertySource() throws Exception {
SpringApplication application = new SpringApplication(ExampleConfig.class);
application.setWebApplicationType(WebApplicationType.NONE);
ConfigurableEnvironment environment = new StandardEnvironment();
application.setEnvironment(environment);
this.context = application.run("--foo=bar");
assertThat(environment).has(matchingPropertySource(CommandLinePropertySource.class, "commandLineArgs"));
}
Aggregations