@Test
public void serviceOnTransactionEndTest() {

  final GrpcTccTransactionEndedEvent[] requestCaptor = new GrpcTccTransactionEndedEvent[1];
  TccEndedEvent event = new TccEndedEvent(globalTxId,localTxId, TransactionStatus.Failed);
  TccEventServiceImplBase serviceImpl = new TccEventServiceImplBase() {
    public void onTccTransactionEnded(GrpcTccTransactionEndedEvent request,
        io.grpc.stub.StreamObserver<GrpcAck> responseObserver) {
      requestCaptor[0] = request;
      responseObserver.onNext(ack);
      responseObserver.onCompleted();
    }
  };
  serviceRegistry.addService(serviceImpl);
  AlphaResponse response =service.tccTransactionStop(event);
  assertThat(requestCaptor[0].getServiceName(), is(serviceConfig.serviceName()));
  assertThat(requestCaptor[0].getInstanceId(), is(serviceConfig.instanceId()));
  assertThat(requestCaptor[0].getGlobalTxId(), is(globalTxId));
  assertThat(requestCaptor[0].getLocalTxId(), is(localTxId));
  assertThat(requestCaptor[0].getStatus(), is(TransactionStatus.Failed.toString()));
  assertThat(response.aborted(), is(false));
}