embedded-database-spring-test icon indicating copy to clipboard operation
embedded-database-spring-test copied to clipboard

Highlight junit 5 support and required changes todo in documentation

Open swapy opened this issue 2 years ago • 2 comments

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.

swapy avatar Mar 27 '23 05:03 swapy

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?

tomix26 avatar Mar 30 '23 13:03 tomix26

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 {
...
}

swapy avatar Apr 04 '23 10:04 swapy