@Test
public void testStartGlobalTransactionWhenSynchronizedVote() {

    // Setup
    final RequestGlobalTransaction rgt = mock(RequestGlobalTransaction.class);
    final InboundCommand command = mock(InboundCommand.class);
    final String traceId = "traceId";
    final String name = "trxname";
    final String parent = "parent";
    final GlobalTransaction globalTransaction = mock(GlobalTransaction.class);
    setupStartTrx(rgt, command, traceId, name, parent, globalTransaction);
    when(command.getStatus()).thenReturn(InboundCommand.Status.PREPARED);
    // Run the test
    GlobalTransaction result = businessGlobalTransactionServiceImplUnderTest.startNewGlobalTransaction(rgt);
    // Verify the results
    verify(globalTransaction).setStatus(same(GlobalTransaction.GlobalTransactionStatus.PREPARED));
    verify(globalTransaction).setParent(same(parent));
    assertEquals(result, globalTransaction);
}