@Test
public void testRegistryStats() throws Exception {
RegistryStats stats = ProxyFactory.create(RegistryStats.class, generateBaseUrl());
RegistryData data = stats.get();
Assert.assertEquals(4, data.getEntries().size());
boolean found = false;
for (RegistryEntry entry : data.getEntries()) {
if (entry.getUriTemplate().equals("/entry/{foo:.*}")) {
Assert.assertEquals(2, entry.getMethods().size());
List<Class> prepareRequiredTypes = prepareRequiredTypes(PostResourceMethod.class, PutResourceMethod.class);
Assert.assertTrue(testMethodTypes(entry.getMethods().get(0), prepareRequiredTypes));
Assert.assertTrue(testMethodTypes(entry.getMethods().get(1), prepareRequiredTypes));
found = true;
break;
}
}
Assert.assertTrue(found);
found = false;
for (RegistryEntry entry : data.getEntries()) {
if (entry.getUriTemplate().equals("/resource")) {
Assert.assertEquals(2, entry.getMethods().size());
List<Class> prepareRequiredTypes = prepareRequiredTypes(HeadResourceMethod.class, DeleteResourceMethod.class);
Assert.assertTrue(testMethodTypes(entry.getMethods().get(0), prepareRequiredTypes));
Assert.assertTrue(testMethodTypes(entry.getMethods().get(1), prepareRequiredTypes));
found = true;
break;
}
}
Assert.assertTrue(found);
found = false;
for (RegistryEntry entry : data.getEntries()) {
if (entry.getUriTemplate().equals("/locator")) {
Assert.assertNotNull(entry.getLocator());
found = true;
break;
}
}
Assert.assertTrue(found);
found = false;
for (RegistryEntry entry : data.getEntries()) {
if (entry.getUriTemplate().equals("/resteasy/registry")) {
Assert.assertEquals(1, entry.getMethods().size());
Assert.assertTrue(entry.getMethods().get(0) instanceof GetResourceMethod);
found = true;
break;