@Override public String getAuthorizationHeader() { return buildJwt("https://madison.example.com/profile/#me", AbstractApplicationAuthTests.this.getJwtSecret()); } }
@Override public String getAuthorizationHeader() { return buildJwt("https://people.apache.org/~acoburn/#i", AbstractApplicationAuthTests.this.getJwtSecret()); } }
@Override public String getAuthorizationHeader() { return buildJwt("https://people.apache.org/~acoburn/#i", AbstractApplicationAuthTests.this.getJwtSecret()); } }
@Override public String getAuthorizationHeader() { return buildJwt("https://madison.example.com/profile/#me", AbstractApplicationAuthTests.this.getJwtSecret()); } }
@Override public String getAuthorizationHeader() { return buildJwt(Trellis.AdministratorAgent.getIRIString(), AbstractApplicationAuthTests.this.getJwtSecret()); } }
@Override public String getAuthorizationHeader() { return buildJwt(Trellis.AdministratorAgent.getIRIString(), AbstractApplicationAuthTests.this.getJwtSecret()); } }
/** * Test receiving an update message. */ @Test @DisplayName("Test receiving an update message") default void testReceiveChildMessage() { final String agent = "https://people.apache.org/~acoburn/#i"; // POST an LDP-RS try (final Response res = target(getContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS POST response"); assertAll("Check the resource parent", checkResourceParentLdpBC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource)); } }
/** * Test receiving a creation event message in a direct container. */ @Test @DisplayName("Test receiving a JMS creation message from a LDP-DC") default void testReceiveCreateMessageDC() { final String agent = "http://example.com/pat#i"; // POST an LDP-RS try (final Response res = target(getDirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST response"); assertAll("Check the LDP-DC parent", checkResourceParentLdpDC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource, LDP.Container)); } }
/** * Test receiving an update message. */ @Test @DisplayName("Test receiving an update message") default void testReceiveChildMessage() { final String agent = "https://people.apache.org/~acoburn/#i"; // POST an LDP-RS try (final Response res = target(getContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS POST response"); assertAll("Check the resource parent", checkResourceParentLdpBC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource)); } }
/** * Test receiving a creation event message in a direct container. */ @Test @DisplayName("Test receiving a JMS creation message from a LDP-DC") default void testReceiveCreateMessageDC() { final String agent = "http://example.com/pat#i"; // POST an LDP-RS try (final Response res = target(getDirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST response"); assertAll("Check the LDP-DC parent", checkResourceParentLdpDC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource, LDP.Container)); } }
/** * Test receiving a creation event message in an indirect container. */ @Test @DisplayName("Test receiving a JMS creation message from a LDP-IC") default void testReceiveCreateMessageIC() { final String agent = "http://example.com/sam#i"; // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())) .post(entity(getResourceAsString("/childResource.ttl"), TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-IC"); assertAll("Check the LDP-IC parent", checkResourceParentLdpIC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource, LDP.Container)); } }
/** * Test receiving a creation event message in an indirect container. */ @Test @DisplayName("Test receiving a JMS creation message from a LDP-IC") default void testReceiveCreateMessageIC() { final String agent = "http://example.com/sam#i"; // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())) .post(entity(getResourceAsString("/childResource.ttl"), TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-IC"); assertAll("Check the LDP-IC parent", checkResourceParentLdpIC(res.getLocation().toString(), agent, AS.Create, LDP.RDFSource, LDP.Container)); } }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message") default void testReceiveDeleteMessage() { final String resource; final String agent1 = "https://madison.example.com/profile#me"; // POST an LDP-RS try (final Response res = target(getContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent1, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS POST response"); resource = res.getLocation().toString(); assertAll("Check the resource parent", checkResourceParentLdpBC(resource, agent1, AS.Create, LDP.RDFSource)); } final String agent2 = "https://pat.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS DELETE response"); assertAll("Check the LDP-BC parent", checkResourceParentLdpBC(resource, agent2, AS.Delete, LDP.Resource)); } }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message in a LDP-DC") default void testReceiveDeleteMessageDC() { final String resource; final String agent = "http://example.com/george#i"; // POST an LDP-RS try (final Response res = target(getDirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-DC"); resource = res.getLocation().toString(); assertAll("Check the LDP-DC parent", checkResourceParentLdpDC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); } final String agent2 = "https://pat.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful LDP-RS DELETE"); assertAll("Check the LDP-DC parent resource", checkResourceParentLdpDC(resource, agent2, AS.Delete, LDP.Resource, LDP.Container)); } }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message in a LDP-DC") default void testReceiveDeleteMessageDC() { final String resource; final String agent = "http://example.com/george#i"; // POST an LDP-RS try (final Response res = target(getDirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-DC"); resource = res.getLocation().toString(); assertAll("Check the LDP-DC parent", checkResourceParentLdpDC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); } final String agent2 = "https://pat.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful LDP-RS DELETE"); assertAll("Check the LDP-DC parent resource", checkResourceParentLdpDC(resource, agent2, AS.Delete, LDP.Resource, LDP.Container)); } }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message") default void testReceiveDeleteMessage() { final String resource; final String agent1 = "https://madison.example.com/profile#me"; // POST an LDP-RS try (final Response res = target(getContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent1, getJwtSecret())).post(entity("", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS POST response"); resource = res.getLocation().toString(); assertAll("Check the resource parent", checkResourceParentLdpBC(resource, agent1, AS.Create, LDP.RDFSource)); } final String agent2 = "https://pat.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Verify a successful LDP-RS DELETE response"); assertAll("Check the LDP-BC parent", checkResourceParentLdpBC(resource, agent2, AS.Delete, LDP.Resource)); } }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message in a LDP-IC") default void testReceiveDeleteMessageIC() { final String resource; final String agent = "http://example.com/addison#i"; final String childContent = getResourceAsString("/childResource.ttl"); // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity(childContent, TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-IC"); resource = res.getLocation().toString(); assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); } final String agent2 = "https://daryl.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful DELETE in an LDP-IC"); assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent2, AS.Delete, LDP.Resource, LDP.Container)); } }
/** * Test receiving a replace message. */ @Test @DisplayName("Test receiving a replace message in a LDP-IC") default void testReceiveReplaceMessageIC() { final String resource; final String agent = "http://example.com/parker#i"; final String childContent = getResourceAsString("/childResource.ttl"); // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity(childContent, TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST to an LDP-IC"); resource = res.getLocation().toString(); } assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); final String agent2 = "https://hayden.example.com/profile#me"; // Replace the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .put(entity(childContent + "\n<> a <http://example.com/Type3> .", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful PUT in an LDP-IC"); } await().atMost(15, SECONDS).until(() -> getMessages().stream() .anyMatch(checkEventGraph(resource, agent2, AS.Update, LDP.RDFSource))); await().atMost(15, SECONDS).until(() -> getMessages().stream() .anyMatch(checkEventGraph(getMemberLocation(), agent2, AS.Update, LDP.Container))); }
/** * Test receiving a delete message. */ @Test @DisplayName("Test receiving a delete message in a LDP-IC") default void testReceiveDeleteMessageIC() { final String resource; final String agent = "http://example.com/addison#i"; final String childContent = getResourceAsString("/childResource.ttl"); // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity(childContent, TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST in an LDP-IC"); resource = res.getLocation().toString(); assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); } final String agent2 = "https://daryl.example.com/profile#me"; // DELETE the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .delete()) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful DELETE in an LDP-IC"); assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent2, AS.Delete, LDP.Resource, LDP.Container)); } }
/** * Test receiving a replace message. */ @Test @DisplayName("Test receiving a replace message in a LDP-IC") default void testReceiveReplaceMessageIC() { final String resource; final String agent = "http://example.com/parker#i"; final String childContent = getResourceAsString("/childResource.ttl"); // POST an LDP-RS try (final Response res = target(getIndirectContainerLocation()).request() .header(AUTHORIZATION, buildJwt(agent, getJwtSecret())).post(entity(childContent, TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful POST to an LDP-IC"); resource = res.getLocation().toString(); } assertAll("Check the LDP-IC parent resource", checkResourceParentLdpIC(resource, agent, AS.Create, LDP.RDFSource, LDP.Container)); final String agent2 = "https://hayden.example.com/profile#me"; // Replace the LDP-RS try (final Response res = target(resource).request().header(AUTHORIZATION, buildJwt(agent2, getJwtSecret())) .put(entity(childContent + "\n<> a <http://example.com/Type3> .", TEXT_TURTLE))) { assertEquals(SUCCESSFUL, res.getStatusInfo().getFamily(), "Check for a successful PUT in an LDP-IC"); } await().atMost(15, SECONDS).until(() -> getMessages().stream() .anyMatch(checkEventGraph(resource, agent2, AS.Update, LDP.RDFSource))); await().atMost(15, SECONDS).until(() -> getMessages().stream() .anyMatch(checkEventGraph(getMemberLocation(), agent2, AS.Update, LDP.Container))); }