@Test
    void verifyOperation() {
        var r = buildTestResource();
        assertTrue(umaResourceSetRepository.getAll().isEmpty());
        assertFalse(umaResourceSetRepository.getById(r.getId()).isPresent());

        r = umaResourceSetRepository.save(r);
        assertFalse(umaResourceSetRepository.getAll().isEmpty());
        assertTrue(umaResourceSetRepository.getById(r.getId()).isPresent());

        val perms = new ResourceSetPolicyPermission();
        perms.setSubject("casuser");
        perms.setScopes(CollectionUtils.wrapHashSet("read", "write"));
        perms.setClaims(new LinkedHashMap<>(CollectionUtils.wrap("givenName", "CAS")));

        val policy = new ResourceSetPolicy();
        policy.setPermissions(CollectionUtils.wrapHashSet(perms));
        r.setOwner("UMA");
        r.setPolicies(CollectionUtils.wrapHashSet(policy));
        r = umaResourceSetRepository.save(r);
        assertEquals("UMA", r.getOwner());
        assertFalse(r.getPolicies().isEmpty());

        umaResourceSetRepository.removeAll();
        assertTrue(umaResourceSetRepository.getAll().isEmpty());
    }
This is {@link PostgresJpaResourceSetRepositoryTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth-uma-jpa/src/test/java/org/apereo/cas/uma/ticket/resource/repository/PostgresJpaResourceSetRepositoryTests.java