@Test
public void testSubscribeEvent() throws Exception {

  // given
  final ContractTemplate contractTemplate = new ContractTemplate(contextStorage);
  final Requester mockRequester = mock(Requester.class);
  final Subscription<Event> expected = mock(Subscription.class);
  when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any()))
      .thenReturn(expected);
  contractTemplate.requester = mockRequester;
  // then
  final EventFilter eventFilter = EventFilter.newBuilder(anyContractAddress).build();
  final Subscription<Event> actual = contractTemplate.subscribeEvent(eventFilter,
      new StreamObserver<Event>() {
        @Override
        public void onNext(Event value) {
        }
        @Override
        public void onError(Throwable t) {
        }
        @Override
        public void onCompleted() {
        }
      });
  assertEquals(expected, actual);
}