{"id":18391625,"url":"https://github.com/wpanas/testcontainers-examples","last_synced_at":"2025-04-07T03:33:40.650Z","repository":{"id":37960447,"uuid":"281740165","full_name":"wpanas/testcontainers-examples","owner":"wpanas","description":"Bunch of sample projects that showcase how to use Testcontainers with Spring Boot, JUnit 5, Kotest together with PostgreSQL or Kafka. Finally, this repo shows not only how to test with Testcontainers, but also how to run your application locally","archived":false,"fork":false,"pushed_at":"2024-12-23T15:07:27.000Z","size":304,"stargazers_count":9,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T12:11:17.192Z","etag":null,"topics":["docker","hacktoberfest","junit","kotlin","samples","spring-boot","test-automation","testcontainers"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpanas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T17:21:40.000Z","updated_at":"2024-10-07T16:40:01.000Z","dependencies_parsed_at":"2024-02-19T20:43:32.395Z","dependency_job_id":"d3c8e827-37ff-433a-9249-fdd403c8eecd","html_url":"https://github.com/wpanas/testcontainers-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpanas%2Ftestcontainers-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpanas%2Ftestcontainers-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpanas%2Ftestcontainers-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpanas%2Ftestcontainers-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpanas","download_url":"https://codeload.github.com/wpanas/testcontainers-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589333,"owners_count":20963018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","hacktoberfest","junit","kotlin","samples","spring-boot","test-automation","testcontainers"],"created_at":"2024-11-06T01:52:38.944Z","updated_at":"2025-04-07T03:33:40.320Z","avatar_url":"https://github.com/wpanas.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testcontainers Examples\n\nThis repository contains sample projects\nthat use [Testcontainers](https://www.testcontainers.org/)\nwith different technologies. \nI hope it will help you use it in your own projects.\n\nAll samples are build with [Kotlin](https://kotlinlang.org/), [Gradle](https://gradle.org/)\n\u0026 [JUnit 5](https://junit.org/junit5/).\n\n👉 If you use JDK 17+ \u0026 Spring Boot 3.1+ go straight\nto the [simplest project](./spring6-junit5/README.md). \nOther projects use older Spring Boot 2.7 to show\nhow to use Testcontainers without all great advancements\nthat since were made. As for now, 2.7 is still commercially supported\nuntil 2025-08-24. I encourage you to update Spring Boot according\nto the [official support timeline](https://spring.io/projects/spring-boot#support)\nto have the best experience with Testcontainers and what not.\n\n## Current tests status is:\n[![wpanas](https://github.com/wpanas/testcontainers-examples/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/wpanas/testcontainers-examples/actions/workflows/ci.yml?query=branch%3Amaster)\n\n# Sample projects\n\n- **NEW!** [[Spring Boot 3.1+]: The simplest Spring MVC, JPA on PostgreSQL \u0026 local running](./spring6-junit5/README.md)\n- [[Spring Boot 2.7]: MVC \u0026 JPA with PostgreSQL](./spring-junit5/README.md)\n- [[Spring Boot 2.7]: MVC \u0026 JPA with Kotest tests](./spring-kotest/README.md)\n- [[Spring Boot 2.7]: MVC \u0026 JPA with PostgreSQL \u0026 local running](./local-db/README.md)\n- [[Spring Boot 2.7]: Kafka with local running](./kafka/README.md)\n\n# How to use it?\n\n## Run all tests\n```shell script\n./gradlew check \n```\n\n## Run kafka module tests\n```shell\n./gradlew kafka:check\n```\n## Run postgres module tests\n```shell\n./gradlew local-db:check \n```\n## Run spring6-junit5 tests\n```shell\n./gradlew spring6-junit5:check \n```\n\n## Run spring-junit5 tests\n```shell\n./gradlew spring-junit5:check\n``` \n\n## Run spring-kotest tests\n```shell\n./gradlew spring-kotest:check\n```\n\n# How to run local development?\n💥 **NEW!** To run locally application with a Postgresql container configured by Testcontainers \u0026 Spring Boot 3.1+.\n```shell\n./gradlew spring6-junit5:bootTestRun\n```\n\nTo run locally application with a Kafka container configured by Testcontainers.\n```shell\n./gradlew kafka:bootLocalRun\n```\n\nTo run locally application with a Postgresql container configured by Testcontainers.\n```shell\n./gradlew local-db:bootLocalRun\n```\n\n# Troubleshooting\n\n## ContainerFetchException\nIf you got `ContainerFetchException` \nbecause of failing `Docker environment should have more than 2GB free disk space`,\nincrease available disc space in Docker for Mac. See [more](https://github.com/testcontainers/testcontainers-java/issues/1726).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpanas%2Ftestcontainers-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpanas%2Ftestcontainers-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpanas%2Ftestcontainers-examples/lists"}