本文整理汇总了Java中org.springframework.boot.actuate.endpoint.InfoEndpoint类的典型用法代码示例。如果您正苦于以下问题:Java InfoEndpoint类的具体用法?Java InfoEndpoint怎么用?Java InfoEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InfoEndpoint类属于org.springframework.boot.actuate.endpoint包,在下文中一共展示了InfoEndpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testInfoEndpointOrdering
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Test
public void testInfoEndpointOrdering() throws Exception {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, "info.name:foo");
this.context.register(CustomInfoContributorsConfig.class,
ProjectInfoAutoConfiguration.class,
InfoContributorAutoConfiguration.class, EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
Map<String, Object> info = endpoint.invoke();
assertThat(info).isNotNull();
assertThat(info.get("name")).isEqualTo("foo");
assertThat(info.get("version")).isEqualTo("1.0");
Object git = info.get("git");
assertThat(git).isInstanceOf(Map.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:18,代码来源:EndpointAutoConfigurationTests.java
示例2: parameters
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@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 } };
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:22,代码来源:MvcEndpointPathConfigurationTests.java
示例3: infoEndpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
public InfoEndpoint infoEndpoint() throws Exception {
LinkedHashMap<String, Object> info = new LinkedHashMap<String, Object>();
for (String filename : getAllPropertiesFiles()) {
Resource resource = new ClassPathResource("/" + filename);
Properties properties = new Properties();
if (resource.exists()) {
properties = PropertiesLoaderUtils.loadProperties(resource);
String name = resource.getFilename();
info.put(name.replace(PROPERTIES_SUFFIX, PROPERTIES_SUFFIX_REPLACEMENT), Maps.fromProperties(properties));
} else {
if (failWhenResourceNotExists()) {
throw new RuntimeException("Resource : " + filename + " does not exist");
} else {
log.info("Resource {} does not exist", filename);
}
}
}
return new InfoEndpoint(info);
}
开发者ID:zalando-stups,项目名称:booties,代码行数:22,代码来源:ExtInfoEndpointConfiguration.java
示例4: endpoints
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@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();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:EndpointAutoConfigurationTests.java
示例5: testInfoEndpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Test
public void testInfoEndpoint() throws Exception {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, "info.foo:bar");
this.context.register(ProjectInfoAutoConfiguration.class,
InfoContributorAutoConfiguration.class, EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
assertThat(endpoint).isNotNull();
assertThat(endpoint.invoke().get("git")).isNotNull();
assertThat(endpoint.invoke().get("foo")).isEqualTo("bar");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:EndpointAutoConfigurationTests.java
示例6: testInfoEndpointNoGitProperties
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Test
public void testInfoEndpointNoGitProperties() throws Exception {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context,
"spring.info.git.location:classpath:nonexistent");
this.context.register(InfoContributorAutoConfiguration.class,
EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
assertThat(endpoint).isNotNull();
assertThat(endpoint.invoke().get("git")).isNull();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:EndpointAutoConfigurationTests.java
示例7: infoEndpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public InfoEndpoint infoEndpoint() throws Exception {
LinkedHashMap<String, Object> info = new LinkedHashMap<String, Object>();
info.putAll(this.properties.infoMap());
GitInfo gitInfo = this.properties.gitInfo();
if (gitInfo.getBranch() != null) {
info.put("git", gitInfo);
}
return new InfoEndpoint(info);
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:EndpointAutoConfiguration.java
示例8: endpoints
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@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));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:14,代码来源:EndpointAutoConfigurationTests.java
示例9: testInfoEndpointConfiguration
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Test
public void testInfoEndpointConfiguration() throws Exception {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, "info.foo:bar");
this.context.register(EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
assertNotNull(endpoint);
assertNotNull(endpoint.invoke().get("git"));
assertEquals("bar", endpoint.invoke().get("foo"));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:EndpointAutoConfigurationTests.java
示例10: testNoGitProperties
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Test
public void testNoGitProperties() throws Exception {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context,
"spring.git.properties:classpath:nonexistent");
this.context.register(EndpointAutoConfiguration.class);
this.context.refresh();
InfoEndpoint endpoint = this.context.getBean(InfoEndpoint.class);
assertNotNull(endpoint);
assertNull(endpoint.invoke().get("git"));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:EndpointAutoConfigurationTests.java
示例11: infoEndpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public InfoEndpoint infoEndpoint() throws Exception {
return new InfoEndpoint(this.infoContributors == null
? Collections.<InfoContributor>emptyList() : this.infoContributors);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:EndpointAutoConfiguration.java
示例12: setUp
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Before
public void setUp() {
this.context.getBean(InfoEndpoint.class).setEnabled(true);
this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:InfoMvcEndpointTests.java
示例13: endpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
public InfoEndpoint endpoint() {
return new InfoEndpoint(Arrays.asList(beanName1(), beanName2()));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:InfoMvcEndpointTests.java
示例14: endpoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
public InfoEndpoint endpoint() {
return new InfoEndpoint(Collections.<InfoContributor>emptyList());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:InfoMvcEndpointWithNoInfoContributorsTests.java
示例15: infoMvcEndPoint
import org.springframework.boot.actuate.endpoint.InfoEndpoint; //导入依赖的package包/类
@Bean
@Autowired
public EndpointMvcAdapter infoMvcEndPoint(InfoEndpoint delegate) {
return new EndpointMvcAdapter(delegate);
}
开发者ID:Contargo,项目名称:iris,代码行数:7,代码来源:ActuatorConfig.java
注:本文中的org.springframework.boot.actuate.endpoint.InfoEndpoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论