Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions modules/openapi/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: OpenAPI
categories:
- cloud
docs:
- id: java
url: https://github.com/gcatanese/openapi-testcontainers
maintainer: community
example: |
```java
@ClassRule
public static GenericContainer container = new GenericContainer(
new ImageFromDockerfile("my-test-cont", false)
.withFileFromFile("openapi.yaml", new File(OPENAPI_FILE))
.withFileFromFile("Dockerfile", new File("Dockerfile"))
)
.withExposedPorts(8080);
```
installation: |
```xml
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a third-party module

<version>1.17.3</version>
<scope>test</scope>
</dependency>
```
description: |
The OpenAPI Testcontainers extension allows developers to create on-the-fly a lightweight Test Container from an
[OpenAPI](https://spec.openapis.org/) specification file. The API container is loaded when the Junit tests start and can be used to mock the different endpoints and payloads.

Read more on [openapi-testcontainers](https://github.com/gcatanese/openapi-testcontainers) and checkout the [demo](https://github.com/gcatanese/openapi-testcontainers-demo).
---