当前位置: 首页>>代码示例>>Java>>正文


Java MockHttpRequest.get方法代码示例

本文整理汇总了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"));	
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:FhirServiceIT.java

示例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"));		
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:FhirServiceIT.java

示例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"));		
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:FhirServiceIT.java

示例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"));		
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:17,代码来源:FhirServiceIT.java

示例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());
}
 
开发者ID:Doccrazy,项目名称:keycloak-protocol-cas,代码行数:12,代码来源:ContentTypeHelperTest.java

示例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);
    }
}
 
开发者ID:binout,项目名称:jaxrs-unit,代码行数:11,代码来源:RestEasyResource.java


注:本文中的org.jboss.resteasy.mock.MockHttpRequest.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。