use of org.apache.geode.management.internal.web.domain.LinkIndex in project geode by apache.
the class ShellCommandsControllerJUnitTest method testCommandHasRestApiControllerWebServiceEndpoint.
@Test
public void testCommandHasRestApiControllerWebServiceEndpoint() {
List<String> controllerWebServiceEndpoints = getControllerWebServiceEndpoints();
assertNotNull(controllerWebServiceEndpoints);
assertFalse(controllerWebServiceEndpoints.isEmpty());
LinkIndex linkIndex = controller.index("http");
assertNotNull(linkIndex);
assertFalse(linkIndex.isEmpty());
List<String> linkWebServiceEndpoints = new ArrayList<>(linkIndex.size());
for (Link link : linkIndex) {
linkWebServiceEndpoints.add(link.toHttpRequestLine());
}
assertEquals(linkIndex.size(), linkWebServiceEndpoints.size());
List<String> missingControllerWebServiceEndpoints = new ArrayList<>(linkWebServiceEndpoints);
missingControllerWebServiceEndpoints.removeAll(controllerWebServiceEndpoints);
assertTrue(String.format("The Management REST API Web Service Controllers in (%1$s) are missing the following REST API Web Service Endpoint(s): %2$s!", getClass().getPackage().getName(), missingControllerWebServiceEndpoints), missingControllerWebServiceEndpoints.isEmpty());
}
use of org.apache.geode.management.internal.web.domain.LinkIndex in project geode by apache.
the class ShellCommandsControllerJUnitTest method testIndexUrisHaveCorrectScheme.
@Test
public void testIndexUrisHaveCorrectScheme() {
String versionCmd = "version";
List<String> controllerWebServiceEndpoints = getControllerWebServiceEndpoints();
assertNotNull(controllerWebServiceEndpoints);
assertFalse(controllerWebServiceEndpoints.isEmpty());
String testScheme = "xyz";
LinkIndex linkIndex = controller.index(testScheme);
assertNotNull(linkIndex);
assertFalse(linkIndex.isEmpty());
assertTrue(String.format("Link does not have correct scheme %1$s", linkIndex.find(versionCmd)), testScheme.equals(linkIndex.find(versionCmd).getHref().getScheme()));
}
Aggregations