parent
5d271c1634
commit
b4770c30fd
2 changed files with 16 additions and 1 deletions
|
@ -126,7 +126,7 @@ public interface PolicyStore {
|
||||||
default List<Policy> findByResourceType(ResourceServer resourceServer, String resourceType) {
|
default List<Policy> findByResourceType(ResourceServer resourceServer, String resourceType) {
|
||||||
List<Policy> result = new LinkedList<>();
|
List<Policy> result = new LinkedList<>();
|
||||||
|
|
||||||
findByResourceType((ResourceServer) null, resourceType, result::add);
|
findByResourceType(resourceServer, resourceType, result::add);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,21 @@ public class ResourceManagementTest extends AbstractAuthorizationTest {
|
||||||
assertEquals(1, attributes.get("b").size());
|
assertEquals(1, attributes.get("b").size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCreateWithResourceType() {
|
||||||
|
ResourceRepresentation newResource = new ResourceRepresentation();
|
||||||
|
|
||||||
|
newResource.setName("test");
|
||||||
|
newResource.setDisplayName("display");
|
||||||
|
newResource.setType("some-type");
|
||||||
|
|
||||||
|
newResource = doCreateResource(newResource);
|
||||||
|
|
||||||
|
ResourceResource resource = getClientResource().authorization().resources().resource(newResource.getId());
|
||||||
|
|
||||||
|
assertTrue(resource.permissions().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void failCreateWithSameName() {
|
public void failCreateWithSameName() {
|
||||||
ResourceRepresentation newResource = createResource();
|
ResourceRepresentation newResource = createResource();
|
||||||
|
|
Loading…
Reference in a new issue