embedded-database-spring-test
embedded-database-spring-test copied to clipboard
Highlight junit 5 support and required changes todo in documentation
Thank you very much @tomix26 for this wonderful project. All efforts appreciated.
I would like to suggest an improvement for docs. Can we mention more about Junit 5 support in documentation?
- required changes to do if any
- unsupported annotation if any eg:
@RepeatedTest
Thanks.
JUnit5 should be supported out of the box, including the @RepeatedTest annotation. All testing frameworks supported by Spring are also supported by this library. I could update the code examples from JUnit4 to JUnit5, but I don't find it particularly important. Or would you suggest any other changes to the documentation?
I would suggest adding one more section mentioning example on how to use with Junit5
example, now I have to go with SpringExtension and it works
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("pgsqltest")
@ExtendWith(SpringExtension.class)
@AutoConfigureMockMvc
@AutoConfigureCache
@AutoConfigureEmbeddedDatabase(refresh = AFTER_EACH_TEST_METHOD, provider = AutoConfigureEmbeddedDatabase.DatabaseProvider.ZONKY, type = AutoConfigureEmbeddedDatabase.DatabaseType.POSTGRES)
@TestPropertySource(properties = {"spring.config.location=classpath:application-pgsqltest.yml"})
class PersonTestIT {
...
}