@Test
public void shouldRecordExtendedRequestData() throws Exception {
Robolectric.addPendingHttpResponse(200, "a happy response body");
HttpGet httpGet = new HttpGet("http://example.com");
requestDirector.execute(null, httpGet, null);
assertSame(Robolectric.getSentHttpRequestInfo(0).getHttpRequest(), httpGet);
ConnectionKeepAliveStrategy strategy = shadowOf((DefaultRequestDirector) Robolectric.getSentHttpRequestInfo(0).getRequestDirector()).getConnectionKeepAliveStrategy();
assertSame(strategy, connectionKeepAliveStrategy);
}
DefaultRequestDirectorTest.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:FullRobolectricTestSample
作者:
评论列表
文章目录