An open API service indexing awesome lists of open source software.

https://github.com/d4sma/testcontainers-java


https://github.com/d4sma/testcontainers-java

api asyncapi contract-testing docker java-25 java-api java-spring-boot localstack microcks micronaut mongodb nunit openapi quarkus s3 spring sqs testcontainers-junit-jupiter

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# 🐳 testcontainers-java - Simplifying Your Testing Experience

[![Download](https://img.shields.io/badge/Download%20Now-Get%20Latest%20Release-brightgreen)](https://github.com/d4sma/testcontainers-java/releases)

## 📦 Overview

Testcontainers is a Java library that helps you run JUnit tests with ease. It provides lightweight and temporary instances of commonly used databases, web browsers, and other configurations all running inside Docker containers. This makes it simple to test applications without needing complex setups.

## 🚀 Getting Started

To use Testcontainers, you need to follow a few steps to download and set up the software on your system.

### 🖥️ System Requirements

- **Operating System:** Windows 10, macOS, or a recent Linux distribution.
- **Java Version:** Java 8 or higher.
- **Docker:** Ensure Docker is installed and running. You can download it from the [Docker website](https://www.docker.com/products/docker-desktop).

## 📥 Download & Install

To get Testcontainers, please visit the Releases page linked below:

[Visit this page to download](https://github.com/d4sma/testcontainers-java/releases)

Once you're on the releases page, find the latest version of Testcontainers and download the appropriate file for your system.

- For Windows, look for `.zip` or `.exe`.
- For macOS, look for `.tar.gz`.
- For Linux, look for `.tar.gz`.

After downloading, follow these steps to install:

1. **Extraction:**
- Windows: Right-click the downloaded `.zip` file and select "Extract All."
- macOS/Linux: Use the terminal to extract the `.tar.gz` file.

2. **Running Testcontainers:**
- Open a terminal or command prompt.
- Navigate to the folder where you extracted Testcontainers.

3. **Running Tests:**
- Follow your Java project setup to include Testcontainers in your dependencies. You may include it in your `pom.xml` or `build.gradle` file.

## 🏗️ Usage

Here is how to use Testcontainers in your JUnit tests:

1. **Set Up Your Test Class:**
Use the Testcontainers annotations to define your tests.

```java
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;

public class MyTest {
@Test
void exampleTest() {
GenericContainer> container = new GenericContainer<>("your-image-name");
container.start();

// Your test code here

container.stop();
}
}
```

2. **Running Tests:**
Run your tests as usual using your IDE or command line.

## 🛠️ Features

- **Lightweight:** No need for lengthy setup, Testcontainers runs instances in isolated Docker containers.
- **Flexible:** Use various databases and web browsers seamlessly.
- **Integration Testing:** Simplifies the integration testing process.

## 🔗 Additional Resources

- [GitHub Repository](https://github.com/d4sma/testcontainers-java) - Explore the source code and documentation.
- [Docker Documentation](https://docs.docker.com/) - Get familiar with Docker concepts.
- [JUnit Documentation](https://junit.org/junit5/docs/current/user-guide/) - Understand how to integrate Testcontainers with JUnit.

## 🐞 Troubleshooting

If you encounter any issues:

- Make sure Docker is running and accessible from your command line.
- Verify your Java version is compatible.
- Check the network settings if containers fail to start or connect.

## 🤝 Contributing

Your feedback helps improve Testcontainers. If you find bugs or have suggestions:

- Open an issue in the [GitHub Issues](https://github.com/d4sma/testcontainers-java/issues) section.
- Join the community discussions or contribute code.

For more detailed guides and advanced setups, refer to the official [documentation](https://github.com/d4sma/testcontainers-java).

## 📅 Changelog

Stay updated with the latest features and bug fixes by monitoring the Release Notes on the [Releases page](https://github.com/d4sma/testcontainers-java/releases).

## 🔒 License

This project is licensed under the MIT License. You can use it as long as you follow the terms outlined in the license document.

---

[Visit this page to download](https://github.com/d4sma/testcontainers-java/releases) and start using Testcontainers today!