/** * Verify that an anonymous user cannot append to a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a protected resource") default void testUserCanAppendProtectedResource() { try (final Response res = target(getProtectedContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot append to a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a protected resource") default void testUserCanAppendProtectedResource() { try (final Response res = target(getProtectedContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot read a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot read a protected resource") default void testCanReadProtectedResource() { try (final Response res = target(getProtectedContainer()).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot read a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot read a protected resource") default void testCanReadProtectedResource() { try (final Response res = target(getProtectedContainer()).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot control a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a protected resource") default void testCanControlProtectedResource() { try (final Response res = target(getProtectedContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot control a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a protected resource") default void testCanControlProtectedResource() { try (final Response res = target(getProtectedContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot write to a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a protected resource") default void testCanWriteProtectedResource() { try (final Response res = target(getProtectedContainer()).request().method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot write to a protected resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a protected resource") default void testCanWriteProtectedResource() { try (final Response res = target(getProtectedContainer()).request().method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }