Java 类org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MvcEndpointPathConfigurationTests.java   
@Parameters(name = "{0}")
public static Object[] parameters() {
    return new Object[] { new Object[] { "actuator", HalJsonMvcEndpoint.class },
            new Object[] { "autoconfig", AutoConfigurationReportEndpoint.class },
            new Object[] { "beans", BeansEndpoint.class },
            new Object[] { "configprops",
                    ConfigurationPropertiesReportEndpoint.class },
            new Object[] { "docs", DocsMvcEndpoint.class },
            new Object[] { "dump", DumpEndpoint.class },
            new Object[] { "env", EnvironmentMvcEndpoint.class },
            new Object[] { "flyway", FlywayEndpoint.class },
            new Object[] { "health", HealthMvcEndpoint.class },
            new Object[] { "info", InfoEndpoint.class },
            new Object[] { "jolokia", JolokiaMvcEndpoint.class },
            new Object[] { "liquibase", LiquibaseEndpoint.class },
            new Object[] { "logfile", LogFileMvcEndpoint.class },
            new Object[] { "mappings", RequestMappingEndpoint.class },
            new Object[] { "metrics", MetricsMvcEndpoint.class },
            new Object[] { "shutdown", ShutdownEndpoint.class },
            new Object[] { "trace", TraceEndpoint.class } };
}
项目:spring-boot-concourse    文件:MvcEndpointPathConfigurationTests.java   
@Parameters(name = "{0}")
public static Object[] parameters() {
    return new Object[] { new Object[] { "actuator", HalJsonMvcEndpoint.class },
            new Object[] { "autoconfig", AutoConfigurationReportEndpoint.class },
            new Object[] { "beans", BeansEndpoint.class },
            new Object[] { "configprops",
                    ConfigurationPropertiesReportEndpoint.class },
            new Object[] { "docs", DocsMvcEndpoint.class },
            new Object[] { "dump", DumpEndpoint.class },
            new Object[] { "env", EnvironmentMvcEndpoint.class },
            new Object[] { "flyway", FlywayEndpoint.class },
            new Object[] { "health", HealthMvcEndpoint.class },
            new Object[] { "info", InfoEndpoint.class },
            new Object[] { "jolokia", JolokiaMvcEndpoint.class },
            new Object[] { "liquibase", LiquibaseEndpoint.class },
            new Object[] { "logfile", LogFileMvcEndpoint.class },
            new Object[] { "mappings", RequestMappingEndpoint.class },
            new Object[] { "metrics", MetricsMvcEndpoint.class },
            new Object[] { "shutdown", ShutdownEndpoint.class },
            new Object[] { "trace", TraceEndpoint.class } };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testSecureByDefault() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertThat(health.getStatus()).isEqualTo(Status.UP);
    assertThat(health.getDetails().get("foo")).isNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testNotSecured() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.security.enabled=false");
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertThat(health.getStatus()).isEqualTo(Status.UP);
    Health map = (Health) health.getDetails().get("test");
    assertThat(map.getDetails().get("foo")).isEqualTo("bar");
}
项目:spring-boot-concourse    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testSecureByDefault() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertThat(health.getStatus()).isEqualTo(Status.UP);
    assertThat(health.getDetails().get("foo")).isNull();
}
项目:spring-boot-concourse    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testNotSecured() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.security.enabled=false");
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertThat(health.getStatus()).isEqualTo(Status.UP);
    Health map = (Health) health.getDetails().get("test");
    assertThat(map.getDetails().get("foo")).isEqualTo("bar");
}
项目:contestparser    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testSecureByDefault() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertEquals(Status.UP, health.getStatus());
    assertEquals(null, health.getDetails().get("foo"));
}
项目:contestparser    文件:HealthMvcEndpointAutoConfigurationTests.java   
@Test
public void testNotSecured() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setServletContext(new MockServletContext());
    this.context.register(TestConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.security.enabled=false");
    this.context.refresh();
    Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
            .invoke(null);
    assertEquals(Status.UP, health.getStatus());
    Health map = (Health) health.getDetails().get("test");
    assertEquals("bar", map.getDetails().get("foo"));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointDisabled() throws Exception {
    endpointDisabled("health", HealthMvcEndpoint.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("health", HealthMvcEndpoint.class);
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointDisabled() throws Exception {
    endpointDisabled("health", HealthMvcEndpoint.class);
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("health", HealthMvcEndpoint.class);
}
项目:contestparser    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointDisabled() throws Exception {
    endpointDisabled("health", HealthMvcEndpoint.class);
}
项目:contestparser    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void healthEndpointEnabledOverride() throws Exception {
    endpointEnabledOverride("health", HealthMvcEndpoint.class);
}
项目:iris    文件:ActuatorConfig.java   
@Bean
@Autowired
public HealthMvcEndpoint healthMvcEndpoint(HealthEndpoint delegate) {

    return new HealthMvcEndpoint(delegate, true);
}