What is Garland?

Garland is a Java library for writing integration tests as type-safe pipelines. Each step transforms and passes data to the next. The compiler enforces the chain — if a step returns the wrong type, the build fails.

UserDto expected = TestUsers.defaultUser();

Pipeline.given(TestUserRequests.createUser(expected))
        .then(httpClient.makeCall(201, UserDto.class))
        .then(Verify.matching(expected))
        .then(Verify.allOf(
                UserMapper.toEntity().andThen(postgresClient.findByFields()),
                UserMapper.toEvent().andThen(kafkaClient.consumeMatching(UserCreatedEvent.class)),
                UserMapper.toDoc().andThen(mongoClient.findByFields())
        ))
        .execute();

One pipeline. One test. HTTP response, Postgres, Kafka, and MongoDB — all verified.

Add to your project

<dependency>
    <groupId>dev.garlandframework</groupId>
    <artifactId>garland-http</artifactId>
    <version>1.0.0</version>
    <scope>test</scope>
</dependency>

Available modules: garland-http, garland-postgres, garland-kafka, garland-mongodb, garland-testng