/** * Test feed read operation by different types of user. * * @param user the user that would attempt operation * @param op the read operation that would be performed * @param isAllowed is operation expected to go through * @throws Exception */ @Test(dataProvider = "generateUserReadOpsPermissions") public void othersReadFeed(final String user, final EntityOp op, final boolean isAllowed) throws Exception { bundles[0].submitClusters(prism); bundles[0].submitFeeds(prism); final boolean executeRes = op.executeAs(user, feedHelper, feedString); Assert.assertEquals( executeRes, isAllowed, "Unexpected result user " + user + " performing: " + op); }
/** * Test edit operation on submitted feed by different users. * * @param user the user that would attempt operation * @param op the edit operation that would be performed * @param isAllowed is operation expected to go through * @throws Exception */ @Test(dataProvider = "generateUserSubmittedEditOpsPermission") public void othersEditSubmittedFeed(final String user, final EntityOp op, boolean isAllowed) throws Exception { bundles[0].submitClusters(prism); bundles[0].submitFeeds(prism); if (op == EntityOp.update) { FeedMerlin feedMerlin = new FeedMerlin(feedString); feedMerlin.addProperty("abc", "xyz"); feedString = feedMerlin.toString(); } final boolean executeRes = op.executeAs(user, feedHelper, feedString); Assert.assertEquals( executeRes, isAllowed, "Unexpected result user " + user + " performing: " + op); }