|
|
@ -79,18 +79,18 @@ class JmxEndpointDiscovererTests {
|
|
|
|
assertThat(getSomething.getDescription()).isEqualTo("Invoke getSomething for endpoint test");
|
|
|
|
assertThat(getSomething.getDescription()).isEqualTo("Invoke getSomething for endpoint test");
|
|
|
|
assertThat(getSomething.getOutputType()).isEqualTo(String.class);
|
|
|
|
assertThat(getSomething.getOutputType()).isEqualTo(String.class);
|
|
|
|
assertThat(getSomething.getParameters()).hasSize(1);
|
|
|
|
assertThat(getSomething.getParameters()).hasSize(1);
|
|
|
|
hasDefaultParameter(getSomething, 0, String.class);
|
|
|
|
assertThat(getSomething.getParameters().get(0).getType()).isEqualTo(String.class);
|
|
|
|
JmxOperation update = operationByName.get("update");
|
|
|
|
JmxOperation update = operationByName.get("update");
|
|
|
|
assertThat(update.getDescription()).isEqualTo("Invoke update for endpoint test");
|
|
|
|
assertThat(update.getDescription()).isEqualTo("Invoke update for endpoint test");
|
|
|
|
assertThat(update.getOutputType()).isEqualTo(Void.TYPE);
|
|
|
|
assertThat(update.getOutputType()).isEqualTo(Void.TYPE);
|
|
|
|
assertThat(update.getParameters()).hasSize(2);
|
|
|
|
assertThat(update.getParameters()).hasSize(2);
|
|
|
|
hasDefaultParameter(update, 0, String.class);
|
|
|
|
assertThat(update.getParameters().get(0).getType()).isEqualTo(String.class);
|
|
|
|
hasDefaultParameter(update, 1, String.class);
|
|
|
|
assertThat(update.getParameters().get(1).getType()).isEqualTo(String.class);
|
|
|
|
JmxOperation deleteSomething = operationByName.get("deleteSomething");
|
|
|
|
JmxOperation deleteSomething = operationByName.get("deleteSomething");
|
|
|
|
assertThat(deleteSomething.getDescription()).isEqualTo("Invoke deleteSomething for endpoint test");
|
|
|
|
assertThat(deleteSomething.getDescription()).isEqualTo("Invoke deleteSomething for endpoint test");
|
|
|
|
assertThat(deleteSomething.getOutputType()).isEqualTo(Void.TYPE);
|
|
|
|
assertThat(deleteSomething.getOutputType()).isEqualTo(Void.TYPE);
|
|
|
|
assertThat(deleteSomething.getParameters()).hasSize(1);
|
|
|
|
assertThat(deleteSomething.getParameters()).hasSize(1);
|
|
|
|
hasDefaultParameter(deleteSomething, 0, String.class);
|
|
|
|
assertThat(deleteSomething.getParameters().get(0).getType()).isEqualTo(String.class);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -239,12 +239,6 @@ class JmxEndpointDiscovererTests {
|
|
|
|
assertThat(parameter.getDescription()).isEqualTo(description);
|
|
|
|
assertThat(parameter.getDescription()).isEqualTo(description);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME rename
|
|
|
|
|
|
|
|
private void hasDefaultParameter(JmxOperation operation, int index, Class<?> type) {
|
|
|
|
|
|
|
|
JmxOperationParameter parameter = operation.getParameters().get(index);
|
|
|
|
|
|
|
|
assertThat(parameter.getType()).isEqualTo(type);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Map<EndpointId, ExposableJmxEndpoint> discover(JmxEndpointDiscoverer discoverer) {
|
|
|
|
private Map<EndpointId, ExposableJmxEndpoint> discover(JmxEndpointDiscoverer discoverer) {
|
|
|
|
Map<EndpointId, ExposableJmxEndpoint> byId = new HashMap<>();
|
|
|
|
Map<EndpointId, ExposableJmxEndpoint> byId = new HashMap<>();
|
|
|
|
discoverer.getEndpoints().forEach((endpoint) -> byId.put(endpoint.getEndpointId(), endpoint));
|
|
|
|
discoverer.getEndpoints().forEach((endpoint) -> byId.put(endpoint.getEndpointId(), endpoint));
|
|
|
|