public void testSubResourceLocators()
{
// sub-resource method SampleResource#get2()
AbstractResourceDescriptor resource = new AbstractResourceDescriptorImpl(SampleResource.class);
SubResourceLocatorDescriptor subResourceLocatorDescriptor =
resource.getSubResourceLocators().values().iterator().next();
assertEquals("{c}/d", subResourceLocatorDescriptor.getPathValue().getPath());
assertEquals(SampleResource.class, subResourceLocatorDescriptor.getParentResource().getObjectClass());
assertEquals(1, subResourceLocatorDescriptor.getMethodParameters().size());
MethodParameter methodParameter = subResourceLocatorDescriptor.getMethodParameters().get(0);
assertTrue(methodParameter.isEncoded());
assertEquals(null, methodParameter.getDefaultValue());
assertEquals(String.class, methodParameter.getParameterClass());
assertEquals(PathParam.class, methodParameter.getAnnotation().annotationType());
assertEquals(2, methodParameter.getAnnotations().length);