/** * Initialize Binary tests. */ @BeforeAll @DisplayName("Initialize Binary tests") default void beforeAllTests() { // POST an LDP-NR try (final Response res = target().request().header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { setResourceLocation(checkCreateResponseAssumptions(res, LDP.NonRDFSource)); } }
/** * Initialize Binary tests. */ @BeforeAll @DisplayName("Initialize Binary tests") default void beforeAllTests() { // POST an LDP-NR try (final Response res = target().request().header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { setResourceLocation(checkCreateResponseAssumptions(res, LDP.NonRDFSource)); } }
/** * Test creating a new binary via POST. */ @Test @DisplayName("Test creating a new binary via POST") default void testPostBinary() { // POST an LDP-NR try (final Response res = target().request().header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { assertAll("Check POSTing LDP-NR", checkNonRdfResponse(res, null)); final String resource = res.getLocation().toString(); assertTrue(resource.startsWith(getBaseURL()), "Check the response location"); assertTrue(resource.length() > getBaseURL().length(), "Check for a nested response location"); } }
/** * Test creating a new binary via POST. */ @Test @DisplayName("Test creating a new binary via POST") default void testPostBinary() { // POST an LDP-NR try (final Response res = target().request().header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { assertAll("Check POSTing LDP-NR", checkNonRdfResponse(res, null)); final String resource = res.getLocation().toString(); assertTrue(resource.startsWith(getBaseURL()), "Check the response location"); assertTrue(resource.length() > getBaseURL().length(), "Check for a nested response location"); } }
/** * Test creating a new binary via POST with a digest header. */ @Test @DisplayName("Test creating a new binary via POST with a digest header") default void testPostBinaryWithDigest() { // POST an LDP-NR try (final Response res = target().request().header(DIGEST, "md5=bUMuG430lSc5B2PWyoNIgA==") .header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { assertAll("Check POSTing LDP-NR with digest", checkNonRdfResponse(res, null)); final String resource = res.getLocation().toString(); assertTrue(resource.startsWith(getBaseURL()), "Check the response location"); assertTrue(resource.length() > getBaseURL().length(), "Check for a nested response location"); } }
/** * Test creating a new binary via POST with a digest header. */ @Test @DisplayName("Test creating a new binary via POST with a digest header") default void testPostBinaryWithDigest() { // POST an LDP-NR try (final Response res = target().request().header(DIGEST, "md5=bUMuG430lSc5B2PWyoNIgA==") .header(SLUG, generateRandomValue(getClass().getSimpleName())) .post(entity(CONTENT, TEXT_PLAIN))) { assertAll("Check POSTing LDP-NR with digest", checkNonRdfResponse(res, null)); final String resource = res.getLocation().toString(); assertTrue(resource.startsWith(getBaseURL()), "Check the response location"); assertTrue(resource.length() > getBaseURL().length(), "Check for a nested response location"); } }