/** * Verify that an anonymous user cannot append to a public resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a public resource") default void testUserCanAppendPublicResource() { try (final Response res = target(getPublicContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot append to a public resource. */ @Test @DisplayName("Verify that an anonymous user cannot append to a public resource") default void testUserCanAppendPublicResource() { try (final Response res = target(getPublicContainer()).request().post(entity("", TEXT_TURTLE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user can read a public resource. */ @Test @DisplayName("Verify that an anonymous user can read a public resource") default void testCanReadPublicResource() { try (final Response res = target(getPublicContainer()).request().get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that an anonymous user cannot control a public resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a public resource") default void testCanControlPublicResource() { try (final Response res = target(getPublicContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user cannot control a public resource. */ @Test @DisplayName("Verify that an anonymous user cannot control a public resource") default void testCanControlPublicResource() { try (final Response res = target(getPublicContainer() + EXT_ACL).request().get()) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }
/** * Verify that an anonymous user can read a public resource. */ @Test @DisplayName("Verify that an anonymous user can read a public resource") default void testCanReadPublicResource() { try (final Response res = target(getPublicContainer()).request().get()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), OK_RESPONSE); } }
/** * Verify that an anonymous user cannot write to a public resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a public resource") default void testCanWritePublicResource() { try (final Response res = target(getPublicContainer()).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 public resource. */ @Test @DisplayName("Verify that an anonymous user cannot write to a public resource") default void testCanWritePublicResource() { try (final Response res = target(getPublicContainer()).request().method(PATCH, entity(INSERT_PROP_BAR, APPLICATION_SPARQL_UPDATE))) { assertEquals(UNAUTHORIZED, fromStatusCode(res.getStatus()), UNAUTHORIZED_RESPONSE); } }