I need to ignore the following @Transactional annotation during my integration tests.
@Service
public class MyClass {
@Transactional(propagation = Propagation.NEVER)
public void doSomething() {
// do something that once in production can not be inside a transaction (reasons are omitted)
}
}
The problem is that all my tests are executed inside a transaction that is rolled back by default. How could I ignore the @Transactional(propagation = Propagation.NEVER) annotation for this method when it is running in the scope of a test (@ActiveProfiles("test")) allowing it to be executed inside a transaction?