org.springframework.boot.actuate.endpoint.web.WebOperation Java Examples

The following examples show how to use org.springframework.boot.actuate.endpoint.web.WebOperation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SkipPatternConfigTest.java    From java-spring-web with Apache License 2.0 6 votes vote down vote up
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;
    }
  };
}
 
Example #2
Source File: AbstractEndpointTests.java    From quickfixj-spring-boot-starter with Apache License 2.0 6 votes vote down vote up
@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);
	});
}
 
Example #3
Source File: WebOperationService.java    From armeria with Apache License 2.0 4 votes vote down vote up
WebOperationService(WebOperation operation,
                    SimpleHttpCodeStatusMapper statusMapper) {
    this.operation = operation;
    this.statusMapper = statusMapper;
}