Mastodon
All posts tagged

Testing

Style Guidelines for Local Variable Type Inference in Java

Style Guidelines for Local Variable Type Inference in Java

A while ago, with Java 10, a new controversial language feature was introduced: var. With var, local variables don’t need the explicit type information on th...

Unit Tests vs Integration Tests

This article will highlight the differences between unit tests and integration tests. It’s widely known that writing tests to increase the quality of softwa...

Mockito Verifying Method Arguments with Inorder

Yesterday, I learned how to verify the method parameter for multiple method calls in Mockito. My pair-programmer and I wrote code that send multiple messages...

Spring Test Slices

In this article, I want to share what I learned about testing a Spring application without loading it completely. This can be done by using @DataJpaTest, @We...

Why Automated Tests are Important

Why Automated Tests are Important

Automated tests like JUnit are a mandatory part of developing software. Recently I saw some bad things happening in a project that are good arguments for aut...

Test-Driven Refactoring

Recently, I stumbled over the following code: public boolean someMethod() { List<String> list = getSomethingFromDatabase(); // something is d...

Spying with Mockito - to call or not to call a method

The other day a weird feature of the testing library Mockito tricked me. Allthough the behavior is mentioned in the documentation, it can not be bad to po...