Spring-boot: @DataJdbcTest is documented as being transactional but isn't

Created on 14 Jul 2019  路  7Comments  路  Source: spring-projects/spring-boot

I'll propose to support the @Transactional as meta-annotation at @DataJdbcTest as same with @JdbcTest. WDYT?

bug

Most helpful comment

I think we probably should. @DataJpaTest also has it.

All 7 comments

I think we probably should. @DataJpaTest also has it.

I think that it is better to support @Transactional not only @DataJdbcTest but also @DataRedisTest,@DataMongoTest,@DataLdapTest.

@yoshikawaa Have you actually needed to add @Transactional yourself for tests that use those other slice annotations? The case is less clear-cut than for @DataJdbcTest since they are often used in reactive applications where transaction support is still being worked on.

@philwebb surely. It may be necessary in the future, but the current need seems to be lower than @DataJdbcTest.

Thanks for the feedback @yoshikawaa, we've discussed at the call yesterday and we'd like to stick with DataJdbcTest for the time being. We can revisit later.

Interestingly enough, the current documentation states that @DataJdbcTest is transactional. We should probably remove that sentence from the ref guide in 2.1.x.

Given that this is documented, let's turn that into a bug and fix the behaviour in 2.1.x

Was this page helpful?
0 / 5 - 0 ratings