Looking for examples of unit tests using @DataJdbcTest annotation

Building data access objects using springs jdbc template, looking for examples of unit tests

the best way to help yourself is, copy paste a java example source code inside IntelliJ IDE, let the IDE convert you java code to kotlin while pasting

Otherwise wait for few days I will give you some code

1 Like

You can refer this code Kotlin JUnit 5 with platform transaction manager

As I am using SQLite I have to make manual coding for transaction manager, but if your code has proper DataSource and proper transaction classes then it is not required

1 Like

Thanks for your reply. I did copy some of my existing tests already and intellij was great about converting, yet it left the optional class in place and didn’t suggest the kotlin nullable so i’m wanting to see some idiomatic examples.

Thanks for the link to your project, have plenty of sql / database experience so swapping between different ones is easy for me. I’ve been using h2 and postgres in this project.

If you have some code examples to share, it would be appreciated.