本文整理汇总了Java中org.jboss.resteasy.mock.MockHttpRequest.get方法的典型用法代码示例。如果您正苦于以下问题:Java MockHttpRequest.get方法的具体用法?Java MockHttpRequest.get怎么用?Java MockHttpRequest.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.resteasy.mock.MockHttpRequest
的用法示例。
在下文中一共展示了MockHttpRequest.get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetPatientHapi
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
@Test
public void testGetPatientHapi() {
MockHttpRequest request = null;
try {
request = MockHttpRequest.get("/fhir/patient/fhirTest?group_id=4");
//http://fhirtest.uhn.ca/baseDstu2/Patient?_id=fhirTest
} catch (URISyntaxException e) {
fail(e.getMessage());
}
MockHttpResponse response = new MockHttpResponse();
dispatcher.invoke(request, response);
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
assertTrue(response.getContentAsString().contains("fhirTest"));
}
示例2: testGetPatientOpenEpic
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
@Test
public void testGetPatientOpenEpic() {
MockHttpRequest request = null;
try {
request = MockHttpRequest.get("/fhir/patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB?group_id=2");
//https://open-ic.epic.com/FHIR/api/FHIR/DSTU2/Patient?_id=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB
} catch (URISyntaxException e) {
fail(e.getMessage());
}
MockHttpResponse response = new MockHttpResponse();
dispatcher.invoke(request, response);
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
assertTrue(response.getContentAsString().contains("Argonaut, Jason"));
}
示例3: testGetOdmHapi
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
@Test
public void testGetOdmHapi() {
MockHttpRequest request = null;
try {
request = MockHttpRequest.get(
"/fhir/patient/fhirTest/odm?project_id=29&instrument=usciit_prep_flu_study&group_id=4&encounter_start=2016-05-29T09:00:00&encounter_end=2016-06-20");
} catch (URISyntaxException e) {
fail(e.getMessage());
}
MockHttpResponse response = new MockHttpResponse();
dispatcher.invoke(request, response);
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
assertTrue(response.getContentAsString().contains("fhirTest"));
}
示例4: testGetOdmOpenEpic
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
@Test
public void testGetOdmOpenEpic() {
MockHttpRequest request = null;
try {
request = MockHttpRequest.get(
"/fhir/patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB/odm?project_id=29&instrument=usciit_prep_flu_study&group_id=2&encounter_start=2016-04-18&encounter_end=2016-04-20");
} catch (URISyntaxException e) {
fail(e.getMessage());
}
MockHttpResponse response = new MockHttpResponse();
dispatcher.invoke(request, response);
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
assertTrue(response.getContentAsString().contains("Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB"));
}
示例5: get
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
private ContentTypeHelper get(String uri, String acceptHeader) throws Exception {
MockHttpRequest req = MockHttpRequest.get(uri);
MockHttpResponse res = new MockHttpResponse();
RequestImpl restReq = new RequestImpl(req, res);
if (acceptHeader != null) {
req = req.header(HttpHeaders.ACCEPT, acceptHeader);
}
return new ContentTypeHelper(req, restReq, req.getUri());
}
示例6: get
import org.jboss.resteasy.mock.MockHttpRequest; //导入方法依赖的package包/类
@Override
public JaxrsResponse get(String mediaType) {
try {
MockHttpRequest request = MockHttpRequest.get(uri);
request.accept(mediaType);
return executeRequest(request);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}