Hacker News new | ask | show | jobs
by ebiester 2252 days ago
I just wish that Kotlin had a testing solution as great as Spock (groovy), or rspec for ruby, for that matter.

But you mention not using Hibernate. I fully agree myself, and used JOOQ, but what is your preference?

3 comments

Kotest is pretty nice as well. I haven't really tried spek but it sounds alright. I'm generally not that much into BDD; IMHO it just leads to lots of verbosity stating the obvious. Mostly junit5 with some nice assertions library (assertk) and mocking library (mockk) covers most of my needs.

For database stuff; I've always preferred good old JdbcTemplate in Spring combined with TransactionTemplate. IMHO writing mapping code is not that much of a problem; especially if you stop pretending that your complex object hierarcy maps 1 to 1 to tables and do a proper database design instead.

Writing that code sounds harder than it is. Compared to littering your models with annotations to say "this field is that column and this type", it's about the same lines of code. Except it's in one place where it is easy to maintain. Several frameworks exist to automate this business of course but given how trivially easy it is to do this manually, I don't see the value.

I just wish that Kotlin had a testing solution as great as Spock (groovy), or rspec for ruby, for that matter.

Have you tried using Spek?

[1]: https://github.com/spekframework/spek

I think I most miss data driven testing with everything but Spock. http://spockframework.org/spock/docs/1.3/data_driven_testing...
I'm a personal fan of Ebean. Its a lot more approachable and the author is easily accessible when you hit issues.

https://ebean.io/