Using @DataMongoTest currently does not enable auto-configuration for transactions which means that tests for transactional behavior, e.g. data not persisted on transaction rollback, will not work out of the box. Adding @ImportAutoConfiguration(TransactionAutoConfiguration.class) (or the equivalent reactive variant) makes this work.
Original StackOverflow post: https://stackoverflow.com/questions/60178310/spring-data-mongodb-transactional-isnt-working/60184283?noredirect=1#comment106470903_60184283