/** * Verify that another user can append to a public resource. */ @Test @DisplayName("Verify that another user can append to a public resource") default void testOtherUserCanAppendProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that another user can append to a public resource. */ @Test @DisplayName("Verify that another user can append to a public resource") default void testOtherUserCanAppendProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that another user can read a protected resource. */ @Test @DisplayName("Verify that another user can read a protected resource") default void testOtherUserCanReadProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that another user can read a protected resource. */ @Test @DisplayName("Verify that another user can read a protected resource") default void testOtherUserCanReadProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that another user cannot control a protected resource. */ @Test @DisplayName("Verify that another user cannot control a protected resource") default void testOtherUserCanControlProtectedResource() { try (final Response res = target(getProtectedContainer() + EXT_ACL).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }
/** * Verify that another user cannot control a protected resource. */ @Test @DisplayName("Verify that another user cannot control a protected resource") default void testOtherUserCanControlProtectedResource() { try (final Response res = target(getProtectedContainer() + EXT_ACL).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }
/** * Verify that another user cannot write to a protected resource. */ @Test @DisplayName("Verify that another user cannot write to a protected resource") default void testOtherUserCanWriteProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()) .method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }
/** * Verify that another user cannot write to a protected resource. */ @Test @DisplayName("Verify that another user cannot write to a protected resource") default void testOtherUserCanWriteProtectedResource() { try (final Response res = target(getProtectedContainer()).request() .header(AUTHORIZATION, getAuthorizationHeader()) .method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }