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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletWithCustomPath() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context,
            "endpoints.jolokia.path=/foo/bar");
    this.context.register(EndpointsConfig.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.context).build();
    mockMvc.perform(MockMvcRequestBuilders.get("/foo/bar"))
            .andExpect(MockMvcResultMatchers.content()
                    .string(Matchers.containsString("\"request\":{\"type\"")));
}
项目: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 } };
}
项目:contestparser    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletWithCustomPath() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context,
            "endpoints.jolokia.path=/foo/bar");
    this.context.register(EndpointsConfig.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertEquals(1,
            this.context.getBeanNamesForType(JolokiaMvcEndpoint.class).length);
    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.context).build();
    mockMvc.perform(MockMvcRequestBuilders.get("/foo/bar"))
            .andExpect(MockMvcResultMatchers.content()
                    .string(Matchers.containsString("\"request\":{\"type\"")));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JolokiaAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public JolokiaMvcEndpoint jolokiaEndpoint() {
    JolokiaMvcEndpoint endpoint = new JolokiaMvcEndpoint();
    endpoint.setInitParameters(getInitParameters());
    return endpoint;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletRegisteredWithAppContext() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, "jolokia.config[key1]:value1",
            "jolokia.config[key2]:value2");
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointDisabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).isEmpty();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointEnabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
}
项目:spring-boot-concourse    文件:JolokiaAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public JolokiaMvcEndpoint jolokiaEndpoint() {
    JolokiaMvcEndpoint endpoint = new JolokiaMvcEndpoint();
    endpoint.setInitParameters(getInitParameters());
    return endpoint;
}
项目:spring-boot-concourse    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletRegisteredWithAppContext() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, "jolokia.config[key1]:value1",
            "jolokia.config[key2]:value2");
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
}
项目:spring-boot-concourse    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletWithCustomPath() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context,
            "endpoints.jolokia.path=/foo/bar");
    this.context.register(EndpointsConfig.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
    MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.context).build();
    mockMvc.perform(MockMvcRequestBuilders.get("/foo/bar"))
            .andExpect(MockMvcResultMatchers.content()
                    .string(Matchers.containsString("\"request\":{\"type\"")));
}
项目:spring-boot-concourse    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointDisabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).isEmpty();
}
项目:spring-boot-concourse    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointEnabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(JolokiaMvcEndpoint.class)).hasSize(1);
}
项目:contestparser    文件:JolokiaAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public JolokiaMvcEndpoint jolokiaEndpoint() {
    JolokiaMvcEndpoint endpoint = new JolokiaMvcEndpoint();
    endpoint.setInitParameters(getInitParameters());
    return endpoint;
}
项目:contestparser    文件:JolokiaAutoConfigurationTests.java   
@Test
public void agentServletRegisteredWithAppContext() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, "jolokia.config[key1]:value1",
            "jolokia.config[key2]:value2");
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertEquals(1,
            this.context.getBeanNamesForType(JolokiaMvcEndpoint.class).length);
}
项目:contestparser    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointDisabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertEquals(0,
            this.context.getBeanNamesForType(JolokiaMvcEndpoint.class).length);
}
项目:contestparser    文件:JolokiaAutoConfigurationTests.java   
private void assertEndpointEnabled(String... pairs) {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            ManagementServerPropertiesAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            JolokiaAutoConfiguration.class);
    this.context.refresh();
    assertEquals(1,
            this.context.getBeanNamesForType(JolokiaMvcEndpoint.class).length);
}