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
Tag: Unit Test
How to Unit Test Your Annotation Processor using jOOR
Annotation processors can be useful as a hacky workaround to get some language feature into the Java language. jOOQ also has an annotation processor that helps validate SQL syntax for: Plain SQL usage (SQL injection risk) SQL dialect support (prevent using an Oracle only feature on MySQL) You can read about it more in detail … Continue reading How to Unit Test Your Annotation Processor using jOOR
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…