mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
DS-3230 Browse by author broken if author name has special character - repair broken tests
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
package org.dspace.app.rest;
|
||||
|
||||
import static com.google.common.net.UrlEscapers.urlPathSegmentEscaper;
|
||||
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
||||
import static org.hamcrest.Matchers.allOf;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
@@ -5764,7 +5765,9 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
|
||||
.andExpect(jsonPath("$._embedded.values[0].label", is("Smith, Donald")))
|
||||
.andExpect(jsonPath("$._embedded.values[0].count", is(1)))
|
||||
.andExpect(jsonPath("$._embedded.values[0]._links.search.href",
|
||||
containsString("api/discover/search/objects?query=Donald&f.author=Smith, Donald,equals")))
|
||||
containsString("api/discover/search/objects?query=Donald&f.author=" +
|
||||
urlPathSegmentEscaper().escape("Smith, Donald,equals")
|
||||
)))
|
||||
.andExpect(jsonPath("$._embedded.values").value(Matchers.hasSize(1)));
|
||||
|
||||
}
|
||||
@@ -5817,7 +5820,9 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
|
||||
.andExpect(jsonPath("$._embedded.values[0].label", is("2017 - 2020")))
|
||||
.andExpect(jsonPath("$._embedded.values[0].count", is(3)))
|
||||
.andExpect(jsonPath("$._embedded.values[0]._links.search.href",
|
||||
containsString("api/discover/search/objects?dsoType=Item&f.dateIssued=[2017 TO 2020],equals")))
|
||||
containsString("api/discover/search/objects?dsoType=Item&f.dateIssued=" +
|
||||
urlPathSegmentEscaper().escape("[2017 TO 2020],equals")
|
||||
)))
|
||||
.andExpect(jsonPath("$._embedded.values").value(Matchers.hasSize(1)));
|
||||
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
package org.dspace.app.rest.matcher;
|
||||
|
||||
import static com.google.common.net.UrlEscapers.urlPathSegmentEscaper;
|
||||
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
|
||||
import static org.hamcrest.Matchers.allOf;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
@@ -24,7 +25,9 @@ public class FacetValueMatcher {
|
||||
hasJsonPath("$.label", is(label)),
|
||||
hasJsonPath("$.type", is("discover")),
|
||||
hasJsonPath("$._links.search.href", containsString("api/discover/search/objects")),
|
||||
hasJsonPath("$._links.search.href", containsString("f.author=" + label + ",equals"))
|
||||
hasJsonPath("$._links.search.href", containsString(
|
||||
"f.author=" + urlPathSegmentEscaper().escape(label) + ",equals"
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user