Fix tests for #342
This commit is contained in:
parent
d76e0008ac
commit
a0ce10cf3f
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 "DiagnosticReport" but found "Patient"\"/></issue></OperationOutcome>";
|
||||||
|
assertEquals(expected, responseContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue