Skip to content

Commit

Permalink
fix: Failure of org.dspace.app.rest.SitemapRestControllerIT when runn…
Browse files Browse the repository at this point in the history
…ing locally

(cherry picked from commit 44fc15f)
  • Loading branch information
ksankeerth authored and github-actions[bot] committed Dec 8, 2023
1 parent 7524d16 commit 16112a4
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 16112a4

Please sign in to comment.