/** * Verify that an anonymous user cannot append to a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a private resource") default void testUserCanAppendPrivateResource() { try (final Response res = target(getPrivateContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot append to a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a private resource") default void testUserCanAppendPrivateResource() { try (final Response res = target(getPrivateContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot control a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a private resource") default void testCanControlPrivateResource() { try (final Response res = target(getPrivateContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot read a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot read a private resource") default void testCanReadPrivateResource() { try (final Response res = target(getPrivateContainer()).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot control a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a private resource") default void testCanControlPrivateResource() { try (final Response res = target(getPrivateContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot read a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot read a private resource") default void testCanReadPrivateResource() { try (final Response res = target(getPrivateContainer()).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot write to a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a private resource") default void testCanWritePrivateResource() { try (final Response res = target(getPrivateContainer()).request().method(PATCH, entity(INSERT_PROP_FOO, APPLICATION_SPARQL_UPDATE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot write to a private resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a private resource") default void testCanWritePrivateResource() { try (final Response res = target(getPrivateContainer()).request().method(PATCH, entity(INSERT_PROP_FOO, APPLICATION_SPARQL_UPDATE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }