From 52ac11976450c321576b648c356df3c4262d312f Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Sat, 10 May 2025 19:02:21 +0200 Subject: [PATCH 1/3] Add OpenAPI extension --- modules/openapi/index.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 modules/openapi/index.md diff --git a/modules/openapi/index.md b/modules/openapi/index.md new file mode 100644 index 0000000..ddd966f --- /dev/null +++ b/modules/openapi/index.md @@ -0,0 +1,32 @@ +--- +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 + + org.testcontainers + testcontainers + 1.17.3 + test + + ``` +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). +--- From dd7a05615a99ab6e00f86795e79c0024e239ab39 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Sat, 10 May 2025 19:06:37 +0200 Subject: [PATCH 2/3] Correct yaml --- modules/openapi/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi/index.md b/modules/openapi/index.md index ddd966f..f6ed799 100644 --- a/modules/openapi/index.md +++ b/modules/openapi/index.md @@ -13,8 +13,9 @@ docs: new ImageFromDockerfile("my-test-cont", false) .withFileFromFile("openapi.yaml", new File(OPENAPI_FILE)) .withFileFromFile("Dockerfile", new File("Dockerfile")) - ) - .withExposedPorts(8080); ``` + ) + .withExposedPorts(8080); + ``` installation: | ```xml From 212a96f640c9094133b59e8df7cbed59e4dac5a8 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Sat, 10 May 2025 19:28:07 +0200 Subject: [PATCH 3/3] Fix yaml --- modules/openapi/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi/index.md b/modules/openapi/index.md index f6ed799..5534a4a 100644 --- a/modules/openapi/index.md +++ b/modules/openapi/index.md @@ -22,8 +22,8 @@ docs: org.testcontainers testcontainers 1.17.3 - test - + test + ``` description: | The OpenAPI Testcontainers extension allows developers to create on-the-fly a lightweight Test Container from an