We have a controller returning a ResponseEntity<StreamingResponseBody>
. When writing mockMvc tests for this controller we use .andDo(MvcResult::getAsyncResult)
.
For the controller to see the data we create in the database in the setup for the test we need to have @Transactional(propagation = Propagation.NEVER)
on the test method.
We would prefere not to have this annotation, both to make the test run faster and for not having to clean up after it manuely.
Has anybody else here seen this issue and found a way of not having @Transactional(propagation = Propagation.NEVER)
on the test method?