Java Code Examples for org.springframework.transaction.support.TransactionSynchronizationUtils#triggerAfterCompletion()

The following examples show how to use org.springframework.transaction.support.TransactionSynchronizationUtils#triggerAfterCompletion() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BatchMetricsImplTest.java    From spring-boot-starter-batch-web with Apache License 2.0 5 votes vote down vote up
@Test
public void incrementBy1Transactional() throws Exception {
	// Given
	TransactionSynchronizationManager.initSynchronization();
	// When
	batchMetrics.increment("counter.test", 1L);
	TransactionSynchronizationUtils.triggerAfterCompletion(TransactionSynchronization.STATUS_COMMITTED);
	// Then
	TransactionSynchronizationManager.clearSynchronization();
}
 
Example 2
Source File: BatchMetricsImplTest.java    From spring-boot-starter-batch-web with Apache License 2.0 5 votes vote down vote up
@Test
public void decrementBy1Transactional() throws Exception {
	// Given
	TransactionSynchronizationManager.initSynchronization();
	// When
	batchMetrics.decrement("counter.test", 1L);
	TransactionSynchronizationUtils.triggerAfterCompletion(TransactionSynchronization.STATUS_COMMITTED);
	// Then
	TransactionSynchronizationManager.clearSynchronization();
}
 
Example 3
Source File: BatchMetricsImplTest.java    From spring-boot-starter-batch-web with Apache License 2.0 5 votes vote down vote up
@Test
public void submitTransactional() throws Exception {
	// Given
	TransactionSynchronizationManager.initSynchronization();
	// When
	batchMetrics.submit("counter.test", 1L);
	TransactionSynchronizationUtils.triggerAfterCompletion(TransactionSynchronization.STATUS_COMMITTED);
	// Then
	TransactionSynchronizationManager.clearSynchronization();
}