Java 类org.springframework.boot.ansi.AnsiOutputEnabledValue 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void enabled() {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "ALWAYS");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.ALWAYS);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabled() throws Exception {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "never");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabledViaApplicationProperties() throws Exception {
    ConfigurableEnvironment environment = new StandardEnvironment();
    TestPropertySourceUtils.addInlinedPropertiesToEnvironment(environment,
            "spring.config.name=ansi");
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    application.setEnvironment(environment);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
项目:spring-boot-concourse    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void enabled() {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "ALWAYS");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.ALWAYS);
}
项目:spring-boot-concourse    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabled() throws Exception {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "never");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
项目:spring-boot-concourse    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabledViaApplicationProperties() throws Exception {
    ConfigurableEnvironment environment = new StandardEnvironment();
    TestPropertySourceUtils.addInlinedPropertiesToEnvironment(environment,
            "spring.config.name=ansi");
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    application.setEnvironment(environment);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
项目:contestparser    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void enabled() {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "ALWAYS");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get(), equalTo(Enabled.ALWAYS));
}
项目:contestparser    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabled() throws Exception {
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    Map<String, Object> props = new HashMap<String, Object>();
    props.put("spring.output.ansi.enabled", "never");
    application.setDefaultProperties(props);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get(), equalTo(Enabled.NEVER));
}
项目:contestparser    文件:AnsiOutputApplicationListenerTests.java   
@Test
public void disabledViaApplicationProperties() throws Exception {
    ConfigurableEnvironment environment = new StandardEnvironment();
    EnvironmentTestUtils.addEnvironment(environment, "spring.config.name:ansi");
    SpringApplication application = new SpringApplication(Config.class);
    application.setWebEnvironment(false);
    application.setEnvironment(environment);
    this.context = application.run();
    assertThat(AnsiOutputEnabledValue.get(), equalTo(Enabled.NEVER));
}