ServiceTest.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:sstore-soft 作者:
/** Tests Service.callMethod(). */
public void testCallMethod() throws Exception {
  FooRequest fooRequest = FooRequest.newBuilder().build();
  BarRequest barRequest = BarRequest.newBuilder().build();
  MockCallback<Message> fooCallback = new MockCallback<Message>();
  MockCallback<Message> barCallback = new MockCallback<Message>();
  TestService mockService = control.createMock(TestService.class);

  mockService.foo(EasyMock.same(mockController), EasyMock.same(fooRequest),
                  this.<FooResponse>wrapsCallback(fooCallback));
  mockService.bar(EasyMock.same(mockController), EasyMock.same(barRequest),
                  this.<BarResponse>wrapsCallback(barCallback));
  control.replay();

  mockService.callMethod(fooDescriptor, mockController,
                         fooRequest, fooCallback);
  mockService.callMethod(barDescriptor, mockController,
                         barRequest, barCallback);
  control.verify();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号