@@ -58,22 +58,22 @@ public interface MementoResourceTests extends MementoCommonTests {
5858 default Map <String , String > getMementos () {
5959 final Map <String , String > mementos = new HashMap <>();
6060 try (final Response res = target (getResourceLocation ()).request ().get ()) {
61- getLinks (res ).stream ().filter (link -> link .getRel ().equals ("memento" ))
61+ getLinks (res ).stream ().filter (link -> link .getRels ().contains ("memento" ))
6262 .filter (l -> l .getParams ().containsKey ("datetime" ))
6363 .forEach (link -> mementos .put (link .getUri ().toString (), link .getParams ().get ("datetime" )));
6464 }
6565 return mementos ;
6666 }
6767
6868 /**
69- * Test the presence of three mementos .
69+ * Test the presence of two memento links .
7070 */
7171 @ Test
72- @ DisplayName ("Test the presence of three mementos " )
72+ @ DisplayName ("Test the presence of two memento links " )
7373 default void testMementosWereFound () {
7474 final Map <String , String > mementos = getMementos ();
7575 assertFalse (mementos .isEmpty (), "Check that mementos were found" );
76- assertEquals (3 , mementos .size (), "Check that 3 mementos were found" );
76+ assertEquals (2 , mementos .size (), "Check that 2 mementos were found" );
7777 }
7878
7979 /**
@@ -165,7 +165,7 @@ default void testMementoContent() {
165165
166166 final IRI subject = rdf .createIRI (getResourceLocation ());
167167 final List <IRI > urls = mementos .keySet ().stream ().sorted ().map (rdf ::createIRI ).collect (toList ());
168- assertEquals (3L , urls .size (), "Check that three mementos were found" );
168+ assertEquals (2L , urls .size (), "Check that two mementos were found" );
169169 assertTrue (dataset .getGraph (urls .get (0 )).isPresent (), "Check that the first graph is present" );
170170 dataset .getGraph (urls .get (0 )).ifPresent (g -> {
171171 assertTrue (g .contains (subject , type , SKOS .Concept ), "Check for a skos:Concept type" );
@@ -176,20 +176,8 @@ default void testMementoContent() {
176176 assertEquals (3L , g .size (), "Check for three triples" );
177177 });
178178
179- assertTrue (dataset .getGraph (urls .get (1 )).isPresent (), "Check that the second graph is present" );
179+ assertTrue (dataset .getGraph (urls .get (1 )).isPresent (), "Check that the last graph is present" );
180180 dataset .getGraph (urls .get (1 )).ifPresent (g -> {
181- assertTrue (g .contains (subject , type , SKOS .Concept ), "Check for a skos:Concept type" );
182- assertTrue (g .contains (subject , SKOS .prefLabel , rdf .createLiteral ("Resource Name" , "eng" )),
183- "Check for a skos:prefLabel property" );
184- assertTrue (g .contains (subject , DC .subject , rdf .createIRI ("http://example.org/subject/1" )),
185- "Check for a dc:subject property" );
186- assertTrue (g .contains (subject , DC .title , rdf .createLiteral ("Title" )),
187- "Check for a dc:title property" );
188- assertEquals (4L , g .size (), "Check for four triples" );
189- });
190-
191- assertTrue (dataset .getGraph (urls .get (2 )).isPresent (), "Check that the third graph is present" );
192- dataset .getGraph (urls .get (2 )).ifPresent (g -> {
193181 assertTrue (g .contains (subject , type , SKOS .Concept ), "Check for a skos:Concept type" );
194182 assertTrue (g .contains (subject , SKOS .prefLabel , rdf .createLiteral ("Resource Name" , "eng" )),
195183 "Check for a skos:prefLabel property" );
0 commit comments