use of example.nontransferable.StrictNoTransfer in project elide by yahoo.
the class PersistentResourceTest method testNoTransferStrictPermissionFailure.
@Test
public void testNoTransferStrictPermissionFailure() {
StrictNoTransfer a = new StrictNoTransfer();
a.setId(1);
StrictNoTransfer b = new StrictNoTransfer();
b.setId(2);
StrictNoTransfer c = new StrictNoTransfer();
c.setId(3);
a.setOther(b);
b.setOther(c);
RequestScope goodScope = buildRequestScope(tx, goodUser);
PersistentResource aResource = new PersistentResource(a, "1", goodScope);
PersistentResource bResource = new PersistentResource(b, aResource, "other", "2", goodScope);
PersistentResource cResource = new PersistentResource(c, bResource, "other", "3", goodScope);
assertThrows(ForbiddenAccessException.class, () -> cResource.addRelation("other", bResource));
}
Aggregations