Skip to main content

The New Beginning framework

TNB is a collection of JUnit 5 extensions designed for testing with external services. It simplifies integration testing by providing automatic deployment, lifecycle management, and validation utilities for over 50 external services.

Key features

Automatic deployment

Services are automatically deployed before tests and cleaned up afterward using JUnit 5 lifecycle hooks

Multiple environments

Deploy services locally with TestContainers or on OpenShift clusters with a simple property change

50+ services

Built-in support for Kafka, databases, cloud providers, message queues, and more

Validation helpers

Convenient methods to interact with services without dealing with complex client APIs

System-X services

There are two categories of System-X services:

Remote services

Internet-facing services that can be accessed publicly:
  • Cloud providers: AWS, Google Cloud, Azure
  • SaaS platforms: Salesforce, Jira, Slack
  • External APIs: Twitter, ServiceNow, Microsoft services
Remote services don’t require deployment - they only establish connections using credentials.

Self-hosted services

Services deployed on-premises or in private environments:
  • Message systems: Kafka, RabbitMQ, IBM MQ, AMQ
  • Databases: PostgreSQL, MySQL, MongoDB, Cassandra
  • File transfer: FTP, SFTP, Samba
  • Search engines: Elasticsearch, OpenSearch
  • And many more: Redis, Vault, Keycloak, Jaeger, etc.
Self-hosted services can be deployed:
  • Locally using TestContainers (set test.use.openshift=false)
  • On OpenShift as cluster deployments (set test.use.openshift=true)
  • Externally by connecting to an existing service (use tnb.<serviceName>.host property)

Service architecture

Each System-X service comprises three components:
1

Account

A Java object containing all connection information (credentials, endpoints, configuration)
2

Client

The native Java client used to access the service
3

Validation

A convenience wrapper around the client offering simplified methods for common operations

Quick example

Here’s a complete Kafka integration test:
KafkaTest.java
public class KafkaTest {
    @RegisterExtension
    public static Kafka kafka = ServiceFactory.create(Kafka.class);

    @Test
    public void testWithKafka() {
        final String topic = "myTopic";
        final String message = "Hello kafka!";
        kafka.validation().produce(topic, message);

        final List<ConsumerRecord<String, String>> records = kafka.validation().consume(topic);
        Assertions.assertEquals(1, records.size());
        Assertions.assertEquals(message, records.get(0).value());
    }
}
The Kafka docker container is automatically:
  • Started before tests run (using @BeforeAll)
  • Available during test execution
  • Stopped and cleaned up after tests complete (using @AfterAll)

Get started

Quick start

Get up and running with your first TNB test in minutes

Installation

Add TNB dependencies to your Maven project

Core concepts

Learn about services, accounts, and validation objects

Available services

Browse the complete catalog of supported System-X services

Use cases

TNB is perfect for:
  • Integration testing Camel routes and microservices with real external dependencies
  • E2E testing complete workflows involving multiple services
  • Local development with production-like infrastructure using containers
  • CI/CD pipelines with consistent, reproducible test environments
TNB is built and maintained by the Red Hat Fuse integration platform team for testing Camel-based applications.

Build docs developers (and LLMs) love