@Bean @ConditionalOnMissingBean public HealthEndpoint healthEndpoint() { return new HealthEndpoint( this.healthAggregator == null ? new OrderedHealthAggregator() : this.healthAggregator, this.healthIndicators == null ? Collections.<String, HealthIndicator>emptyMap() : this.healthIndicators); }
@Test public void endpoints() throws Exception { load(EndpointAutoConfiguration.class); assertThat(this.context.getBean(BeansEndpoint.class)).isNotNull(); assertThat(this.context.getBean(DumpEndpoint.class)).isNotNull(); assertThat(this.context.getBean(EnvironmentEndpoint.class)).isNotNull(); assertThat(this.context.getBean(HealthEndpoint.class)).isNotNull(); assertThat(this.context.getBean(InfoEndpoint.class)).isNotNull(); assertThat(this.context.getBean(MetricsEndpoint.class)).isNotNull(); assertThat(this.context.getBean(ShutdownEndpoint.class)).isNotNull(); assertThat(this.context.getBean(TraceEndpoint.class)).isNotNull(); assertThat(this.context.getBean(RequestMappingEndpoint.class)).isNotNull(); }
@Test public void healthEndpoint() { load(EmbeddedDataSourceConfiguration.class, EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class); HealthEndpoint bean = this.context.getBean(HealthEndpoint.class); assertThat(bean).isNotNull(); Health result = bean.invoke(); assertThat(result).isNotNull(); assertThat(result.getDetails().containsKey("db")).isTrue(); }
@Test public void healthEndpointWithDefaultHealthIndicator() { load(EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class); HealthEndpoint bean = this.context.getBean(HealthEndpoint.class); assertThat(bean).isNotNull(); Health result = bean.invoke(); assertThat(result).isNotNull(); }
@Before public void init() { this.endpoint = mock(HealthEndpoint.class); given(this.endpoint.isEnabled()).willReturn(true); this.mvc = new HealthMvcEndpoint(this.endpoint); this.environment = new MockEnvironment(); this.mvc.setEnvironment(this.environment); }
@Test public void endpoints() throws Exception { load(EndpointAutoConfiguration.class); assertNotNull(this.context.getBean(BeansEndpoint.class)); assertNotNull(this.context.getBean(DumpEndpoint.class)); assertNotNull(this.context.getBean(EnvironmentEndpoint.class)); assertNotNull(this.context.getBean(HealthEndpoint.class)); assertNotNull(this.context.getBean(InfoEndpoint.class)); assertNotNull(this.context.getBean(MetricsEndpoint.class)); assertNotNull(this.context.getBean(ShutdownEndpoint.class)); assertNotNull(this.context.getBean(TraceEndpoint.class)); assertNotNull(this.context.getBean(RequestMappingEndpoint.class)); }
@Test public void healthEndpoint() { load(EmbeddedDataSourceConfiguration.class, EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class); HealthEndpoint bean = this.context.getBean(HealthEndpoint.class); assertNotNull(bean); Health result = bean.invoke(); assertNotNull(result); assertTrue("Wrong result: " + result, result.getDetails().containsKey("db")); }
@Test public void healthEndpointWithDefaultHealthIndicator() { load(EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class); HealthEndpoint bean = this.context.getBean(HealthEndpoint.class); assertNotNull(bean); Health result = bean.invoke(); assertNotNull(result); }
public HealthMvcEndpoint(HealthEndpoint delegate) { this(delegate, true); }
public HealthMvcEndpoint(HealthEndpoint delegate, boolean secure) { super(delegate); this.secure = secure; setupDefaultStatusMapping(); }
@Bean @ConditionalOnMissingBean public HealthEndpoint healthEndpoint() { return new HealthEndpoint(this.healthAggregator, this.healthIndicators); }
@Bean @Autowired public HealthMvcEndpoint healthMvcEndpoint(HealthEndpoint delegate) { return new HealthMvcEndpoint(delegate, true); }