当前位置: 首页>>代码示例>>Java>>正文


Java EndpointMvcAdapter类代码示例

本文整理汇总了Java中org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter的典型用法代码示例。如果您正苦于以下问题:Java EndpointMvcAdapter类的具体用法?Java EndpointMvcAdapter怎么用?Java EndpointMvcAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EndpointMvcAdapter类属于org.springframework.boot.actuate.endpoint.mvc包,在下文中一共展示了EndpointMvcAdapter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beanMethodMappings

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
@Test
public void beanMethodMappings() {
	StaticApplicationContext context = new StaticApplicationContext();
	EndpointHandlerMapping mapping = new EndpointHandlerMapping(
			Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
	mapping.setApplicationContext(new StaticApplicationContext());
	mapping.afterPropertiesSet();
	context.getDefaultListableBeanFactory().registerSingleton("mapping", mapping);
	this.endpoint.setApplicationContext(context);
	Map<String, Object> result = this.endpoint.invoke();
	assertThat(result).hasSize(1);
	assertThat(result.keySet().iterator().next().contains("/dump")).isTrue();
	@SuppressWarnings("unchecked")
	Map<String, Object> handler = (Map<String, Object>) result.values().iterator()
			.next();
	assertThat(handler.containsKey("method")).isTrue();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:18,代码来源:RequestMappingEndpointTests.java

示例2: concreteMethodMappings

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
@Test
public void concreteMethodMappings() {
	EndpointHandlerMapping mapping = new EndpointHandlerMapping(
			Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
	mapping.setApplicationContext(new StaticApplicationContext());
	mapping.afterPropertiesSet();
	this.endpoint.setMethodMappings(
			Collections.<AbstractHandlerMethodMapping<?>>singletonList(mapping));
	Map<String, Object> result = this.endpoint.invoke();
	assertThat(result).hasSize(1);
	assertThat(result.keySet().iterator().next().contains("/dump")).isTrue();
	@SuppressWarnings("unchecked")
	Map<String, Object> handler = (Map<String, Object>) result.values().iterator()
			.next();
	assertThat(handler.containsKey("method")).isTrue();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:RequestMappingEndpointTests.java

示例3: beanMethodMappings

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
@Test
public void beanMethodMappings() {
	StaticApplicationContext context = new StaticApplicationContext();
	EndpointHandlerMapping mapping = new EndpointHandlerMapping(
			Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
	mapping.setApplicationContext(new StaticApplicationContext());
	mapping.afterPropertiesSet();
	context.getDefaultListableBeanFactory().registerSingleton("mapping", mapping);
	this.endpoint.setApplicationContext(context);
	Map<String, Object> result = this.endpoint.invoke();
	assertEquals(1, result.size());
	assertTrue(result.keySet().iterator().next().contains("/dump"));
	@SuppressWarnings("unchecked")
	Map<String, Object> handler = (Map<String, Object>) result.values().iterator()
			.next();
	assertTrue(handler.containsKey("method"));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:18,代码来源:RequestMappingEndpointTests.java

示例4: concreteMethodMappings

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
@Test
public void concreteMethodMappings() {
	EndpointHandlerMapping mapping = new EndpointHandlerMapping(
			Arrays.asList(new EndpointMvcAdapter(new DumpEndpoint())));
	mapping.setApplicationContext(new StaticApplicationContext());
	mapping.afterPropertiesSet();
	this.endpoint.setMethodMappings(
			Collections.<AbstractHandlerMethodMapping<?>>singletonList(mapping));
	Map<String, Object> result = this.endpoint.invoke();
	assertEquals(1, result.size());
	assertTrue(result.keySet().iterator().next().contains("/dump"));
	@SuppressWarnings("unchecked")
	Map<String, Object> handler = (Map<String, Object>) result.values().iterator()
			.next();
	assertTrue(handler.containsKey("method"));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:17,代码来源:RequestMappingEndpointTests.java

示例5: getConfiguredPath

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
private String getConfiguredPath() {
	if (MvcEndpoint.class.isAssignableFrom(this.endpointClass)) {
		return ((MvcEndpoint) this.context.getBean(this.endpointClass)).getPath();
	}
	for (MvcEndpoint endpoint : this.context.getBean(MvcEndpoints.class)
			.getEndpoints()) {
		if (endpoint instanceof EndpointMvcAdapter && this.endpointClass
				.isInstance(((EndpointMvcAdapter) endpoint).getDelegate())) {
			return ((EndpointMvcAdapter) endpoint).getPath();
		}
	}
	throw new IllegalStateException(
			"Could not get configured path for " + this.endpointClass);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:MvcEndpointPathConfigurationTests.java

示例6: infoMvcEndPoint

import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; //导入依赖的package包/类
@Bean
@Autowired
public EndpointMvcAdapter infoMvcEndPoint(InfoEndpoint delegate) {

    return new EndpointMvcAdapter(delegate);
}
 
开发者ID:Contargo,项目名称:iris,代码行数:7,代码来源:ActuatorConfig.java


注:本文中的org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。