unit tests for head operation
-reverting the removal of the unit test but with the correct status code -added unit test for a valid patient
This commit is contained in:
parent
65a54bfe29
commit
d46878be86
|
@ -55,6 +55,28 @@ public class BanUnsupprtedHttpMethodsInterceptorDstu3Test {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeadJsonWithInvalidPatient() throws Exception {
|
||||
HttpHead httpGet = new HttpHead("http://localhost:" + ourPort + "/Patient/123");
|
||||
HttpResponse status = ourClient.execute(httpGet);
|
||||
assertEquals(null, status.getEntity());
|
||||
ourLog.info(status.toString());
|
||||
|
||||
assertEquals(404, status.getStatusLine().getStatusCode());
|
||||
assertThat(status.getFirstHeader("x-powered-by").getValue(), containsString("HAPI"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeadJsonWithValidPatient() throws Exception {
|
||||
HttpHead httpGet = new HttpHead("http://localhost:" + ourPort + "/Patient/1");
|
||||
HttpResponse status = ourClient.execute(httpGet);
|
||||
assertEquals(null, status.getEntity());
|
||||
ourLog.info(status.toString());
|
||||
|
||||
assertEquals(200, status.getStatusLine().getStatusCode());
|
||||
assertThat(status.getFirstHeader("x-powered-by").getValue(), containsString("HAPI"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHttpTrackNotEnabled() throws Exception {
|
||||
HttpRequestBase req = new HttpRequestBase() {
|
||||
|
|
Loading…
Reference in New Issue