@Test public void testGetSubResourceDefinitions() throws Exception { PermissionResourceDefinition permissionResourceDefinition = new PermissionResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = permissionResourceDefinition.getSubResourceDefinitions (); Set<Resource.Type> expectedSubTypes = new HashSet<Resource.Type>(); expectedSubTypes.add(Resource.Type.RoleAuthorization); Assert.assertEquals(1, subResourceDefinitions.size()); for(SubResourceDefinition subResourceDefinition:subResourceDefinitions) { Assert.assertTrue(expectedSubTypes.contains(subResourceDefinition.getType())); } }
@Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.RoleAuthorization)); return subResourceDefinitions; }
PermissionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.RoleAuthorization)); return subResourceDefinitions; } }
PermissionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.RoleAuthorization)); return subResourceDefinitions; } PermissionResourceDefinition(); }
PermissionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.RoleAuthorization)); return subResourceDefinitions; } PermissionResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions(); }
PermissionResourceDefinition extends BaseResourceDefinition { @Override public Set<SubResourceDefinition> getSubResourceDefinitions() { Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.RoleAuthorization)); return subResourceDefinitions; } PermissionResourceDefinition(); @Override String getPluralName(); @Override String getSingularName(); @Override Set<SubResourceDefinition> getSubResourceDefinitions();  }