try (final Response res = target(getIndirectContainerLocation()).request().get()) { assertAll("Check the container resource", checkRdfResponse(res, LDP.IndirectContainer, TEXT_TURTLE_TYPE)); final Graph g = readEntityAsGraph(res.getEntity(), getBaseURL(), TURTLE); assertFalse(g.contains(rdf.createIRI(getIndirectContainerLocation()), LDP.contains, null), "Check for no ldp:contains property"); etag4 = res.getEntityTag(); try (final Response res = target(getIndirectContainerLocation()).request() .post(entity(childContent, TEXT_TURTLE))) { assertAll("Check POSTing a child resource", checkRdfResponse(res, LDP.RDFSource, null)); child1 = res.getLocation().toString(); assertTrue(child1.startsWith(getIndirectContainerLocation()), "Check the Location header"); assertTrue(child1.length() > getIndirectContainerLocation().length(), "Re-check the Location header"); try (final Response res = target(getIndirectContainerLocation()).request() .post(entity(childContent, TEXT_TURTLE))) { assertAll("Check POSTing a child resource", checkRdfResponse(res, LDP.RDFSource, null)); child2 = res.getLocation().toString(); assertTrue(child2.startsWith(getIndirectContainerLocation()), "Check the Location header"); assertTrue(child2.length() > getIndirectContainerLocation().length(), "Re-check the Location header"); try (final Response res = target(getIndirectContainerLocation()).request().get()) { assertAll("Check the container resource", checkRdfResponse(res, LDP.IndirectContainer, TEXT_TURTLE_TYPE)); final Graph g = readEntityAsGraph(res.getEntity(), getBaseURL(), TURTLE); final IRI identifier = rdf.createIRI(getIndirectContainerLocation()); assertTrue(g.contains(identifier, LDP.contains, rdf.createIRI(child1)), "Check for first ldp:contains"); assertTrue(g.contains(identifier, LDP.contains, rdf.createIRI(child2)), "Check for second ldp:contains"); await().until(() -> !etag5.equals(getETag(getIndirectContainerLocation())));
try (final Response res = target(getIndirectContainerLocation()).request().get()) { assertAll("Check the container resource", checkRdfResponse(res, LDP.IndirectContainer, TEXT_TURTLE_TYPE)); final Graph g = readEntityAsGraph(res.getEntity(), getBaseURL(), TURTLE); assertFalse(g.contains(rdf.createIRI(getIndirectContainerLocation()), LDP.contains, null), "Check for no ldp:contains property"); etag4 = res.getEntityTag(); try (final Response res = target(getIndirectContainerLocation()).request() .post(entity(childContent, TEXT_TURTLE))) { assertAll("Check POSTing a child resource", checkRdfResponse(res, LDP.RDFSource, null)); child1 = res.getLocation().toString(); assertTrue(child1.startsWith(getIndirectContainerLocation()), "Check the Location header"); assertTrue(child1.length() > getIndirectContainerLocation().length(), "Re-check the Location header"); try (final Response res = target(getIndirectContainerLocation()).request() .post(entity(childContent, TEXT_TURTLE))) { assertAll("Check POSTing a child resource", checkRdfResponse(res, LDP.RDFSource, null)); child2 = res.getLocation().toString(); assertTrue(child2.startsWith(getIndirectContainerLocation()), "Check the Location header"); assertTrue(child2.length() > getIndirectContainerLocation().length(), "Re-check the Location header"); try (final Response res = target(getIndirectContainerLocation()).request().get()) { assertAll("Check the container resource", checkRdfResponse(res, LDP.IndirectContainer, TEXT_TURTLE_TYPE)); final Graph g = readEntityAsGraph(res.getEntity(), getBaseURL(), TURTLE); final IRI identifier = rdf.createIRI(getIndirectContainerLocation()); assertTrue(g.contains(identifier, LDP.contains, rdf.createIRI(child1)), "Check for first ldp:contains"); assertTrue(g.contains(identifier, LDP.contains, rdf.createIRI(child2)), "Check for second ldp:contains"); await().until(() -> !etag5.equals(getETag(getIndirectContainerLocation())));