Skip to content

Commit

Permalink
Fix tests to work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Nov 1, 2017
1 parent 0fb74e5 commit 3cd7c8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ca.uhn.fhir.jpa.provider.r4;

import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.util.UrlUtil;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
Expand Down Expand Up @@ -30,14 +31,14 @@ public void testInstanceSimpleRead() throws IOException {
try {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
assertEquals(resp, "{\n" +
assertEquals(TestUtil.stripReturns(resp), TestUtil.stripReturns("{\n" +
" \"name\":[{\n" +
" \"family\":\"FAM\",\n" +
" \"given\":[\"GIVEN1\",\"GIVEN2\"]\n" +
" },{\n" +
" \"given\":[\"GivenOnly1\",\"GivenOnly2\"]\n" +
" }]\n" +
"}");
"}"));
} finally {
IOUtils.closeQuietly(response);
}
Expand All @@ -55,7 +56,7 @@ public void testSystemSimpleSearch() throws IOException {
try {
String resp = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(resp);
assertEquals(resp, "{\n" +
assertEquals(TestUtil.stripReturns(resp), TestUtil.stripReturns("{\n" +
" \"PatientList\":[{\n" +
" \"name\":[{\n" +
" \"family\":\"FAM\",\n" +
Expand All @@ -68,7 +69,7 @@ public void testSystemSimpleSearch() throws IOException {
" \"given\":[\"GivenOnlyB1\",\"GivenOnlyB2\"]\n" +
" }]\n" +
" }]\n" +
"}");
"}"));
} finally {
IOUtils.closeQuietly(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public void testGraphInstance() throws Exception {
ourLog.info(responseContent);
assertEquals(200, status.getStatusLine().getStatusCode());

assertEquals(TestUtil.stripReturns("{" +
" \"name\":[{" +
" \"family\":\"FAMILY\"," +
" \"given\":[\"GIVEN1\",\"GIVEN2\"]" +
" },{" +
" \"given\":[\"GivenOnly1\",\"GivenOnly2\"]" +
" }]" +
assertEquals(TestUtil.stripReturns("{\n" +
" \"name\":[{\n" +
" \"family\":\"FAMILY\",\n" +
" \"given\":[\"GIVEN1\",\"GIVEN2\"]\n" +
" },{\n" +
" \"given\":[\"GivenOnly1\",\"GivenOnly2\"]\n" +
" }]\n" +
"}"), TestUtil.stripReturns(responseContent));
assertThat(status.getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue(), startsWith("application/json"));

Expand Down

0 comments on commit 3cd7c8a

Please sign in to comment.