How to Integration Test Stored Procedures with jOOQ

When you write stored procedures and functions in your database, you want to ensure their correctness, just like with your Java code. In Java, this is done with unit tests, typically with JUnit. For example, if you have the following code in Java: public static int add(int a, int b) { return a + b; … Continue reading How to Integration Test Stored Procedures with jOOQ

Using H2 as a Test Database Product with jOOQ

The H2 database is an immensely popular in-memory database product mostly used by Java developers for testing. If you check out the DB-Engines ranking, it ranks 50th, which is quite impressive, as this rank outperforms products like: CockroachDBIgniteSingle Store (previously MemSQL)Interbase (which was forked as Firebird)Ingres (which is a predecessor to the awesome PostgreSQL)Google BigTable … Continue reading Using H2 as a Test Database Product with jOOQ

Using Testcontainers to Generate jOOQ Code

Database first is at the core of jOOQ's design. jOOQ has been made primarily for classic systems the database is always there and always has been and will never leave. This is because we think "data have mass" https://twitter.com/ChrisRSaxon/status/1093122970254536704 This not only translates to moving logic closer to the data (see our previous posts about … Continue reading Using Testcontainers to Generate jOOQ Code

jOOQ Tuesdays: Richard North Makes Database Testing More Reproducible with Testcontainers

Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. I'm very excited to … Continue reading jOOQ Tuesdays: Richard North Makes Database Testing More Reproducible with Testcontainers

Stop Unit Testing Database Code

Writing tests that use an actual database is hard. Period. Now that this has been established, let's have a look at a blog post by Marco Behler, in which he elaborates on various options when testing database code, with respect to transactionality. Testing database transactions is even harder than just testing database code. Marco lists … Continue reading Stop Unit Testing Database Code

Static, Non-Static. Mockable, Non-Mockable… Instead, Let’s Focus on Real Added Value…

The never ending topic of testability... Dogmatic discussions about stuff being static, non-static. Mockable, non-mockable. Testable, non-testable. Here's an article that was recently syndicated on DZone, about the evilness in making things static: http://java.dzone.com/articles/why-static-bad-and-how-avoid While the article itself is still somewhat focused on simple means of making something mockable through dependency injection, the big lot … Continue reading Static, Non-Static. Mockable, Non-Mockable… Instead, Let’s Focus on Real Added Value…

Easy Mocking of Your Database

Test-driven development is something wonderful! Once you've established it in your organisation, you will start to: Greatly improve your quality (things break less often) Greatly improve your processes (things can be changed more easily) Greatly improve your developer atmosphere (things are more fun to do) The importance of doing the right test-driven development is to … Continue reading Easy Mocking of Your Database