类org.springframework.boot.actuate.endpoint.web.WebOperation源码实例Demo

下面列出了怎么用org.springframework.boot.actuate.endpoint.web.WebOperation的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: java-spring-web   文件: SkipPatternConfigTest.java
private ExposableWebEndpoint createEndpoint(final String name) {
  return new ExposableWebEndpoint() {

    @Override
    public String getRootPath() {
      return name;
    }

    @Override
    public EndpointId getEndpointId() {
      return EndpointId.of(name);
    }

    @Override
    public boolean isEnableByDefault() {
      return false;
    }

    @Override
    public Collection<WebOperation> getOperations() {
      return null;
    }
  };
}
 
@SuppressWarnings("unchecked")
void assertReadProperties(Class<?> testConfigClass) {
	load(testConfigClass, (discoverer) -> {
		Map<EndpointId, ExposableWebEndpoint> endpoints = mapEndpoints(discoverer.getEndpoints());
		assertThat(endpoints).containsKey(endpointId);

		ExposableWebEndpoint endpoint = endpoints.get(endpointId);
		assertThat(endpoint.getOperations()).hasSize(1);

		WebOperation operation = endpoint.getOperations().iterator().next();
		Object invoker = ReflectionTestUtils.getField(operation, "invoker");
		assertThat(invoker).isInstanceOf(ReflectiveOperationInvoker.class);

		Map<String, Properties> properties = (Map<String, Properties>) ((ReflectiveOperationInvoker) invoker).invoke(
				new InvocationContext(mock(SecurityContext.class), Collections.emptyMap()));
		assertThat(properties).hasSize(1);
	});
}
 
源代码3 项目: armeria   文件: WebOperationService.java
WebOperationService(WebOperation operation,
                    SimpleHttpCodeStatusMapper statusMapper) {
    this.operation = operation;
    this.statusMapper = statusMapper;
}
 
 类所在包
 同包方法