@Test
    void verifyUpdateFails() {
        val repo = new DefaultResourceSetRepository();
        val set1 = buildTestResource();
        val set2 = buildTestResource();
        set2.setId(0);
        assertThrows(IllegalArgumentException.class, () -> repo.update(set1, set2));

        set2.setId(1230);
        assertThrows(IllegalArgumentException.class, () -> repo.update(set1, set2));

        set1.setId(9876);
        set2.setId(set1.getId());
        val perm = new ResourceSetPolicyPermission().setScopes(CollectionUtils.wrapHashSet("unknown"));
        val policy = new ResourceSetPolicy().setPermissions(CollectionUtils.wrapHashSet(perm));
        set2.getPolicies().add(policy);
        assertThrows(IllegalArgumentException.class, () -> repo.update(set1, set2));
    }
This is {@link DefaultResourceSetRepositoryTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-oauth-uma/src/test/java/org/apereo/cas/uma/ticket/resource/repository/impl/DefaultResourceSetRepositoryTests.java