Overview - Smile CDR Documentation

SmileCdrContainer and SmileHarness Overview

Looking for a tutorial or walkthrough on how to write automated tests? See the tutorial!

Introduction

The cdr-public-test-utils library provides powerful tools for writing tests that interact with Smile CDR. Two of the most important components in this library are SmileCdrContainer and SmileHarness, which together enable developers to easily set up and interact with Smile CDR instances in their tests.

What is SmileCdrContainer?

SmileCdrContainer is a specialized Testcontainers implementation that simplifies the process of running Smile CDR in Docker containers for testing purposes. It extends the GenericContainer class from the Testcontainers library and provides Smile CDR-specific functionality.

Key features of SmileCdrContainer include:

What is SmileHarness?

SmileHarness is an interface that provides a unified common API for interacting with a Smile CDR instance during testing. It abstracts away the details of connecting to different endpoints and services within Smile CDR, making it easier to write tests that interact with these services.

The primary implementation, DockerSmileHarness, is designed to work with Smile CDR instances running in Docker containers, particularly those managed by SmileCdrContainer.

Key features of SmileHarness include:

How They Work Together

In a typical test scenario:

  1. A SmileCdrContainer is created and started, which launches a Smile CDR Docker container.
  2. The SmileCdrContainer provides a SmileHarness instance through its getHarness() method.
  3. The test uses the SmileHarness to obtain clients for interacting with the Smile CDR instance.
  4. These clients are used to perform operations against the Smile CDR instance as part of the test.

This approach allows for comprehensive integration testing of applications that interact with Smile CDR, without the need to manually set up and configure a Smile CDR instance for each test run.

Next Steps

For more information on how to use these components in your tests, see the other documentation in this section. For a tutorial, please check out the tutorial page.

Overview

Testing Tools

Overview Usage Clients Best Practices

Usage