/** * Verify that a user cannot control the child of a protected resource. */ @Test @DisplayName("Verify that a user cannot control the child of a protected resource") default void testUserCannotControlProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild() + EXT_ACL).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }
/** * Verify that a user can read the child of a protected resource. */ @Test @DisplayName("Verify that a user can read the child of a protected resource") default void testUserCanReadProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild()).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that a user cannot control the child of a protected resource. */ @Test @DisplayName("Verify that a user cannot control the child of a protected resource") default void testUserCannotControlProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild() + EXT_ACL).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(FORBIDDEN, fromStatusCode(res.getStatus()), FORBIDDEN_RESPONSE); } }
/** * Verify that a user can read the child of a protected resource. */ @Test @DisplayName("Verify that a user can read the child of a protected resource") default void testUserCanReadProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild()).request() .header(AUTHORIZATION, getAuthorizationHeader()).get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that a user can write to the child of a protected resource. */ @Test @DisplayName("Verify that a user can write to the child of a protected resource") default void testUserCanWriteProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild()).request() .header(AUTHORIZATION, getAuthorizationHeader()) .method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that a user can write to the child of a protected resource. */ @Test @DisplayName("Verify that a user can write to the child of a protected resource") default void testUserCanWriteProtectedResourceChild() { try (final Response res = target(getProtectedContainerChild()).request() .header(AUTHORIZATION, getAuthorizationHeader()) .method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }