@ConditionalOnEnabledEndpoint("actuator") @Bean public HalJsonMvcEndpoint halJsonMvcEndpoint( ManagementServletContext managementServletContext, ResourceProperties resources, ResourceLoader resourceLoader) { if (HalBrowserMvcEndpoint.getHalBrowserLocation(resourceLoader) != null) { return new HalBrowserMvcEndpoint(managementServletContext); } return new HalJsonMvcEndpoint(managementServletContext); }
@ConditionalOnProperty(prefix = "endpoints.actuator", name = "enabled", matchIfMissing = true) @Bean public ActuatorHalJsonEndpoint actuatorMvcEndpoint( ManagementServletContext managementServletContext, ResourceProperties resources, ResourceLoader resourceLoader) { if (ActuatorHalBrowserEndpoint.getHalBrowserLocation(resourceLoader) != null) { return new ActuatorHalBrowserEndpoint(managementServletContext); } return new ActuatorHalJsonEndpoint(managementServletContext); }
@Autowired public WebConfig(final ResourceProperties resourceProperties) { this.resourceProperties = resourceProperties; }
@Test public void resourceCachePeriodIsZero() throws Exception { this.context = initializeAndRun(WebResourcesConfig.class); ResourceProperties properties = this.context.getBean(ResourceProperties.class); assertThat(properties.getCachePeriod()).isEqualTo(0); }
@Test public void resourceCachePeriodIsZero() throws Exception { this.context = initializeAndRun(WebResourcesConfig.class); ResourceProperties properties = this.context.getBean(ResourceProperties.class); assertThat(properties.getCachePeriod(), equalTo(0)); }