Skip to content

Commit

Permalink
Merge pull request DSpace#9224 from DSpace/backport-9220-to-dspace-7_x
Browse files Browse the repository at this point in the history
[Port dspace-7_x] fix: Failure of org.dspace.app.rest.SitemapRestControllerIT when running locally
  • Loading branch information
alanorth authored Dec 8, 2023
2 parents 7524d16 + 16112a4 commit 5606c8b
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ public void testSitemap_sitemapIndexXml() throws Exception {
//** THEN **
.andExpect(status().isOk())
//We expect the content type to match
.andExpect(content().contentType("application/xml;charset=UTF-8"))
.andExpect(res -> {
String actual = res.getResponse().getContentType();
assertTrue("Content Type",
"text/xml;charset=UTF-8".equals(actual) ||
"application/xml;charset=UTF-8".equals(actual));
})
.andReturn();

String response = result.getResponse().getContentAsString();
Expand All @@ -232,7 +237,12 @@ public void testSitemap_sitemap0Xml() throws Exception {
//** THEN **
.andExpect(status().isOk())
//We expect the content type to match
.andExpect(content().contentType("application/xml;charset=UTF-8"))
.andExpect(res -> {
String actual = res.getResponse().getContentType();
assertTrue("Content Type",
"text/xml;charset=UTF-8".equals(actual) ||
"application/xml;charset=UTF-8".equals(actual));
})
.andReturn();

String response = result.getResponse().getContentAsString();
Expand Down

0 comments on commit 5606c8b

Please sign in to comment.