Join the State of Testing Survey 2018

PractiTest is running the annual State of Testing Survey until the end of January. Go there and give your input!

Gil Zilberfeld talks about using an anti-pattern in Spring integration tests where flags are used in the tests for mocking and controlling simulators

Integration Testing with Spring: Configuration Logic in Integration Tests

Now that we’ve covered some of Spring capabilities, we can explore possibilities beyond simple mocking. Instead of “regular” mocks (that we can set up in the integration tests), we can inject actual simulators. For our purpose, let’s define a simulator… Continue Reading…

Gil Zilberfeld explains another part of Spring support for integration tests and configuration classes.

Integration Testing with Spring: A Custom Configuration

Here’s the situation: We have a couple of configuration files we use for integration tests. Each of them is a different set of real and mock objects. Some of the objects have behaviors set on them (using Mockito.when) in the… Continue Reading…

Gil Zilberfeld explains how clean code should read and explain the relationship between types. Using class inheritance maybe

Clean Code: The Rectangle and the Square – Part II

Last time, in the first post in my new clean code series, we discussed how I torment my students with the ol’ Square and Rectangle trick in my Clean Code course, talking about Liskov Substitution Principle (LSP). At the end… Continue Reading…

Gil Zilberfeld explains how in clean code similar things may not be so in clean code

Clean Code: The Rectangle and the Square – Part I

In my Clean Code class, I go through this example about the Liskov Substitution Principle (LSP), part of the SOLID material. This example, the rectangle and the square, never fails to stump people, both experienced and less so. It starts out… Continue Reading…

Gil Zilberfeld talks about integration testing a REST API

Integration Testing with Spring – Testing A REST API

After we understand how to use mocks in Spring in integration tests, let’s take a look at a setup for testing a REST service that uses a dependency we want to mock. API testing is a usual integration test scenario,… Continue Reading…

Gil Zilberfeld explains how to configure spring with mocks for integration tests

Integration Testing with Spring – Mocking

Let’s continue where we’ve left off – multiple configurations for integration tests. We use different configurations when we need to inject two different sets of objects. For example a real one and mocked one of the same type for different… Continue Reading…

Gil Zilberfeld talks about configuration for mocking in integration tests and unit tesitng

Integration Testing with Spring – Configurations

First, a couple of words about Spring in general as a dependency injection framework. One of the best things in Spring is its simplicity of injection. Regardless of where you are, you pop an @Autowired annotation on a class variable (which… Continue Reading…

TDD Is unlikely to win

How TDD Can Conquer The World (And Why It’s Unlikely To Happen)

He said: “I asked all my friends, and none of them likes TDD”. This one I haven’t heard before, although I suspect I should have at some point. Like any practice, TDD has a social side. I told him to… Continue Reading…

Unit testing anti-pattern: Leaking

Unit Tests Anti-Pattern: Leaky Mocks and Data

Unit tests can leak mocks, setup and expectations if not isolated properly. Leaky data, passing from tests to tests can also hurt us.

Copyright Gil Zilberfeld, 2025