In the last weeks, I've been improving my computer science knowledge by solving programming problems. Since these problems have multiple solutions, I find myself writing duplicated unit tests. And refactoring these tests is cumbersome (if find&replace doesn't work). To make the point clear, I'm going to pick a problem with many possible implementations: sorting an … Continue reading Unit testing algorithms
Tag: java
Database integration tests
Did you ever get stuck while trying to find the best way to write a database integration test without mocking the third party? I know I did. I've known about Martin Fowler since I was a junior developer. He is one of my favorite technology thought-leaders and I enjoy reading the thought-provoking articles that he … Continue reading Database integration tests
JCrete 2018 was amazing
I know it’s after the fact, but I want to share my experience at JCrete2018. I encourage you to join the invite lottery when it opens up in December. A disclaimer: JCrete overwhelmed me and I am not able to do it justice in this post. The participants were incredibly knowledgeable and I felt humbled … Continue reading JCrete 2018 was amazing
Maven plugins that I like
I’ve been through a couple of projects until now and I’m noticing that there are a couple of maven plugins that are useful but are not that famous. I’ll list them below, together with a small explanation of why I find them useful. Build Number Maven Plugin (org.codehaus.mojo) Sometimes you want to expose the current … Continue reading Maven plugins that I like
Java Unconferences/Open-spaces
This year I attended CITCON and then I searched for a similar Java unconference/open-space. I got super lucky to be accepted at JCrete, but that’s another story. The reality is that unconferences are mind-blowing, but a bit hard to find if you don’t know what to look for. These are the unconferences that I currently … Continue reading Java Unconferences/Open-spaces
Testing JPQL queries straight from Intellij
In my current project, most of the queries are written in Java Persistence Query Language (JPQL). As with any *QL (that eventually gets translated to SQL), it’s cumbersome to do the translation of the *QL to SQL and vice-versa. This translation is generally done when you’re creating a new query or trying to debug an … Continue reading Testing JPQL queries straight from Intellij
Inspecting in-memory HSQLDB
Sometimes, for automatic testing of your Java application, you need to configure a DB connection. Most of the time the decision is to go for an in-memory database and HSQLDB is a prime candidate. Some other times, your tests will be failing and it would be great to see the DB status before the failure. … Continue reading Inspecting in-memory HSQLDB
Excluding Hibernate entities from auto-generation
Today I had to do something completely new with Hibernate, within the scope of a unit test. I had a group of entities and wanted to exclude one of them from the schema auto-generation (hibernate.hbm2ddl.auto=create). After spending a couple of hours trying out different things and reading Stackoverflow answers, I hit jackpot with this cool … Continue reading Excluding Hibernate entities from auto-generation