@Test(expected = BusinessGlobalTransactionInstableException.class) public void testStartGlobalTransactionWhenGTXNotNull() { final RequestGlobalTransaction rgt = mock(RequestGlobalTransaction.class); when(rgt.getGTX()).thenReturn(anyString()); businessGlobalTransactionServiceImplUnderTest.startNewGlobalTransaction(rgt); }
GlobalTransaction startNewGlobalTransaction(RequestGlobalTransaction rgt) { String traceId = null; if (rgt.getGTX() != null) { throw new BusinessGlobalTransactionInstableException(rgt); } traceId = trace(rgt); GlobalTransaction globalTransaction = GlobalTransaction.create(rgt.getName(), traceId); if (this.isSynchronizedVote(rgt)) { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.PREPARED); } else { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.STARTED); } globalTransaction.setParent(rgt.getParent()); return globalTransaction; }
BusinessGlobalTransactionServiceImpl implements BusinessGlobalTransactionService { GlobalTransaction startNewGlobalTransaction(RequestGlobalTransaction rgt) { String traceId = null; if (rgt.getGTX() != null) { throw new BusinessGlobalTransactionInstableException(rgt); } traceId = trace(rgt); GlobalTransaction globalTransaction = GlobalTransaction.create(rgt.getName(), traceId); if (this.isSynchronizedVote(rgt)) { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.PREPARED); } else { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.STARTED); } globalTransaction.setParent(rgt.getParent()); return globalTransaction; } }
BusinessGlobalTransactionServiceImpl implements BusinessGlobalTransactionService { GlobalTransaction startNewGlobalTransaction(RequestGlobalTransaction rgt) { String traceId = null; if (rgt.getGTX() != null) { throw new BusinessGlobalTransactionInstableException(rgt); } traceId = trace(rgt); GlobalTransaction globalTransaction = GlobalTransaction.create(rgt.getName(), traceId); if (this.isSynchronizedVote(rgt)) { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.PREPARED); } else { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.STARTED); } globalTransaction.setParent(rgt.getParent()); return globalTransaction; } BusinessGlobalTransactionServiceImpl(); @Autowired  BusinessGlobalTransactionServiceImpl(GlobalTransactionRepository globalTransactionRepository,
												Tracer tracer,
												ApplicationEventPublisher publisher); }
BusinessGlobalTransactionServiceImpl implements BusinessGlobalTransactionService { GlobalTransaction startNewGlobalTransaction(RequestGlobalTransaction rgt) { String traceId = null; if (rgt.getGTX() != null) { throw new BusinessGlobalTransactionInstableException(rgt); } traceId = trace(rgt); GlobalTransaction globalTransaction = GlobalTransaction.create(rgt.getName(), traceId); if (this.isSynchronizedVote(rgt)) { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.PREPARED); } else { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.STARTED); } globalTransaction.setParent(rgt.getParent()); return globalTransaction; } BusinessGlobalTransactionServiceImpl(); @Autowired  BusinessGlobalTransactionServiceImpl(GlobalTransactionRepository globalTransactionRepository,
												Tracer tracer,
												ApplicationEventPublisher publisher); @Override Optional<GlobalTransaction> findGlobalTransaction(final String id); @Override GlobalTransaction participateToGlobalTransaction(Optional<RequestGlobalTransaction> orgt); @Override Optional<GlobalTransaction> retrieveGlobalTransaction(Optional<RequestGlobalTransaction> orgt); }
BusinessGlobalTransactionServiceImpl implements BusinessGlobalTransactionService { GlobalTransaction startNewGlobalTransaction(RequestGlobalTransaction rgt) { String traceId = null; if (rgt.getGTX() != null) { throw new BusinessGlobalTransactionInstableException(rgt); } traceId = trace(rgt); GlobalTransaction globalTransaction = GlobalTransaction.create(rgt.getName(), traceId); if (this.isSynchronizedVote(rgt)) { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.PREPARED); } else { globalTransaction.setStatus(GlobalTransaction.GlobalTransactionStatus.STARTED); } globalTransaction.setParent(rgt.getParent()); return globalTransaction; } BusinessGlobalTransactionServiceImpl(); @Autowired  BusinessGlobalTransactionServiceImpl(GlobalTransactionRepository globalTransactionRepository,
												Tracer tracer,
												ApplicationEventPublisher publisher); @Override Optional<GlobalTransaction> findGlobalTransaction(final String id); @Override GlobalTransaction participateToGlobalTransaction(Optional<RequestGlobalTransaction> orgt); @Override Optional<GlobalTransaction> retrieveGlobalTransaction(Optional<RequestGlobalTransaction> orgt);  }