Fix tests for #342

This commit is contained in:
jamesagnew 2016-04-22 07:55:55 -04:00
parent d76e0008ac
commit a0ce10cf3f
2 changed files with 7 additions and 5 deletions

View File

@ -224,7 +224,7 @@ public class CreateTest {
IOUtils.closeQuietly(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent());
ourLog.info("Response was:\n{}", responseContent); ourLog.info("Response was:\n{}", responseContent);
assertEquals(500, status.getStatusLine().getStatusCode()); assertEquals(400, status.getStatusLine().getStatusCode());
assertThat(responseContent, containsString("Unexpected char")); assertThat(responseContent, containsString("Unexpected char"));
} }
@ -246,7 +246,7 @@ public class CreateTest {
IOUtils.closeQuietly(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent());
ourLog.info("Response was:\n{}", responseContent); ourLog.info("Response was:\n{}", responseContent);
assertEquals(500, status.getStatusLine().getStatusCode()); assertEquals(400, status.getStatusLine().getStatusCode());
assertThat(responseContent, containsString("Unexpected character")); assertThat(responseContent, containsString("Unexpected character"));
} }

View File

@ -76,7 +76,7 @@ public class UpdateTest {
} }
@Test @Test
public void testUpdateMethodReturnsInvalidId() throws Exception { public void testUpdateWithWrongResourceType() throws Exception {
Patient patient = new Patient(); Patient patient = new Patient();
patient.addIdentifier().setValue("002"); patient.addIdentifier().setValue("002");
@ -91,8 +91,10 @@ public class UpdateTest {
ourLog.info("Response was:\n{}", responseContent); ourLog.info("Response was:\n{}", responseContent);
assertEquals(500, status.getStatusLine().getStatusCode()); assertEquals(400, status.getStatusLine().getStatusCode());
String expected = "<OperationOutcome xmlns=\"http://hl7.org/fhir\"><issue><severity value=\"error\"/><details value=\"Failed to parse request body as XML resource. Error was: DataFormatException at [[row,col {unknown-source}]: [1,1]]: Incorrect resource type found, expected &quot;DiagnosticReport&quot; but found &quot;Patient&quot;\"/></issue></OperationOutcome>";
assertEquals(expected, responseContent);
} }
@Test @Test