本文整理汇总了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"));
}
示例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"));
}
示例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);
}