@Test
public void serviceOnEndParticipateTest() {

  final GrpcParticipationEndedEvent[] requestCaptor = new GrpcParticipationEndedEvent[1];
  ParticipationEndedEvent event = new ParticipationEndedEvent(globalTxId,localTxId, parentTxId, confirmMethod,
      cancelMethod, TransactionStatus.Succeed);
  TccEventServiceImplBase serviceImpl = new TccEventServiceImplBase() {
    public void onParticipationEnded(GrpcParticipationEndedEvent request,
        StreamObserver<GrpcAck> responseObserver) {
      requestCaptor[0] = request;
      responseObserver.onNext(ack);
      responseObserver.onCompleted();
    }
  };
  serviceRegistry.addService(serviceImpl);
  AlphaResponse response =service.participationEnd(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].getParentTxId(), is(parentTxId));
  assertThat(requestCaptor[0].getStatus(), is(TransactionStatus.Succeed.toString()));
  assertThat(response.aborted(), is(false));
}