All Projects → Playtika → Testcontainers Spring Boot

Playtika / Testcontainers Spring Boot

Licence: mit
Container auto-configurations for spring-boot based integration tests

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Testcontainers Spring Boot

Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-78.26%)
Mutual labels:  kafka, redis, mongodb, spring-boot, rabbitmq
Springbootexamples
Spring Boot 学习教程
Stars: ✭ 794 (+72.61%)
Mutual labels:  kafka, redis, mongodb, spring-boot
Goodskill
🐂基于springcloud +dubbo构建的模拟秒杀项目,模块化设计,集成了分库分表、elasticsearch🔍、gateway、mybatis-plus、spring-session等常用开源组件
Stars: ✭ 786 (+70.87%)
Mutual labels:  kafka, redis, mongodb, rabbitmq
Spring Samples For All
spring、spring-boot、spring-cloud 常用整合用例
Stars: ✭ 401 (-12.83%)
Mutual labels:  kafka, redis, mongodb, rabbitmq
Mall
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Stars: ✭ 54,797 (+11812.39%)
Mutual labels:  redis, mongodb, spring-boot, rabbitmq
Gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Stars: ✭ 398 (-13.48%)
Mutual labels:  kafka, redis, mariadb, rabbitmq
Tadpolefordbtools
Stars: ✭ 523 (+13.7%)
Mutual labels:  oracle, mongodb, dynamodb, mariadb
Springbootlearning
《Spring Boot教程》源码
Stars: ✭ 2,065 (+348.91%)
Mutual labels:  redis, mongodb, spring-boot, rabbitmq
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-77.39%)
Mutual labels:  kafka, redis, mongodb, spring-boot
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (-6.96%)
Mutual labels:  kafka, redis, spring-boot, rabbitmq
Superman
Superman是什么:构建Java 高级开发技术的知识体系,从基础不断打怪升级成为超人之路(更新中.......)
Stars: ✭ 106 (-76.96%)
Mutual labels:  kafka, redis, spring-boot, rabbitmq
Dataengineeringproject
Example end to end data engineering project.
Stars: ✭ 82 (-82.17%)
Mutual labels:  kafka, redis, mongodb, minio
My Moments
Instagram Clone - Cloning Instagram for learning purpose
Stars: ✭ 140 (-69.57%)
Mutual labels:  kafka, mongodb, neo4j, spring-boot
Kkbinlog
支持mysql、MongoDB数据变更订阅分发
Stars: ✭ 112 (-75.65%)
Mutual labels:  kafka, mongodb, spring-boot, rabbitmq
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (-20.43%)
Mutual labels:  kafka, redis, mongodb, rabbitmq
Spring Boot Demo
Spring Boot & Spring Cloud & Spring Security Demo Case(Spring学习示例实战项目)
Stars: ✭ 255 (-44.57%)
Mutual labels:  redis, mongodb, spring-boot
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (-61.74%)
Mutual labels:  oracle, mongodb, mariadb
Surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service gove…
Stars: ✭ 3,088 (+571.3%)
Mutual labels:  kafka, redis, rabbitmq
Zxw.framework.netcore
基于EF Core的Code First模式的DotNetCore快速开发框架,其中包括DBContext、IOC组件autofac和AspectCore.Injector、代码生成器(也支持DB First)、基于AspectCore的memcache和Redis缓存组件,以及基于ICanPay的支付库和一些日常用的方法和扩展,比如批量插入、更新、删除以及触发器支持,当然还有demo。欢迎提交各种建议、意见和pr~
Stars: ✭ 691 (+50.22%)
Mutual labels:  oracle, redis, mongodb
Hibernate Ogm
Hibernate OGM - Domain model persistence for NoSQL datastores
Stars: ✭ 299 (-35%)
Mutual labels:  redis, mongodb, neo4j

= Data services library

https://codecov.io/gh/Playtika/testcontainers-spring-boot[image:https://codecov.io/gh/testcontainers/testcontainers-spring-boot/branch/master/graph/badge.svg[codecov]] https://www.codacy.com/app/PlaytikaCodacy/testcontainers-spring-boot?utm_source=github.com&utm_medium=referral&utm_content=testcontainers/testcontainers-spring-boot&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/add0d68eb8e040a1833a8f457189af7b[Codacy Badge]] https://maven-badges.herokuapp.com/maven-central/com.playtika.testcontainers/testcontainers-spring-boot[image:https://maven-badges.herokuapp.com/maven-central/com.playtika.testcontainers/testcontainers-spring-boot/badge.svg[Maven Central]]

If you develop services using Spring Boot and maybe Spring Cloud and you do https://testing.googleblog.com/2010/12/test-sizes.html[medium sized] tests during build process, then this set of Spring Boot auto-configurations might be handy. By adding module into classpath, you will get stateful service, like Couchbase or Kafka, auto-started and available for connection from your application service w/o wiring any additional code. https://www.docker.com/[Docker] and https://www.testcontainers.org/[TestContainers] are used to bootstrap stateful service using Spring Cloud https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_the_bootstrap_application_context[bootstrap phase]. Usage of Spring Cloud in your production code is optional, but you will need it in tests. See <<how-to-use, How to use>> below.

[[how-to-use]] == How to use

. https://docs.docker.com/install/[Install Docker] on your machine . Make sure you have http://projects.spring.io/spring-cloud/#quick-start[Spring Boot and Spring Cloud] in classpath of your tests. In case if you need to https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-bootstrap[pick version]. + .pom.xml [source,xml]

... org.springframework.cloud spring-cloud-starter-bootstrap [pick version] ... ---- + NOTE: `testcontainers-spring-boot` project migrated to Spring Boot 2.4 in 2.0.0 version. Please note, that in order to use this project with Spring Boot 2.4, you need to use `spring-cloud-starter-bootstrap` dependency. For earlier Spring Boot (prior to 2.4) users -- you need to use `spring-cloud-starter` dependency instead.

. If you do not use Spring Cloud - make it work for tests only: + .pom.xml [source,xml]

... org.springframework.boot spring-boot-starter [pick version] org.springframework.cloud spring-cloud-starter-bootstrap [pick version] test ... ----

. Add data service library: + .pom.xml [source,xml]

... com.playtika.testcontainers embedded-kafka [pick version] test ... ----

. Use produced properties in your configuration. + Example: + ./src/test/resources/application.properties [source,properties]

spring.kafka.bootstrap-servers=${embedded.kafka.brokerList}

./src/test/resources/bootstrap.properties [source,properties]

embedded.kafka.topicsToCreate=some_topic

== In-depth guides, how-tos and samples

== Common configuration options === Shutdown of embedded containers on spring application shutdown immediately ./src/test/resources/application.properties [source,properties]

embedded.containers.forceShutdown=true //default is false

NOTE: Otherwise, it will be shutdown with delay, see https://github.com/testcontainers/moby-ryuk

=== Disables all embedded containers

./src/test/resources/bootstrap.properties [source,properties]

embedded.containers.enabled=true //default is true

NOTE: If you setup, for example embedded.kafka.enabled + embedded.containers.enabled, result will be same as using AND between two booleans.

NOTE: embedded.kafka.enabled=false will cause DockerNotPresentException if you don't have docker installed. But embedded.containers.enabled=false won't cause any exceptions in this case.

|=== |Setting1 |Setting2 |Outcome

|embedded.containers.enabled=false |embedded.memsql.enabled=true |Memsql will not start

|embedded.containers.enabled=true |embedded.memsql.enabled=false |Memsql will not start

|embedded.containers.enabled=true |embedded.memsql.enabled=true |Memsql will start

|embedded.containers.enabled is missing |embedded.memsql.enabled is missing |Memsql will start |===

=== Other specific container related properties |=== |Setting name | Default value |Description

|embedded.{module-name}.waitTimeoutInSeconds |60 |Waiting time for a container to start in seconds

|embedded.{module-name}.enabled |true |Enables a container to be started on startup

|embedded.{module-name}.reuseContainer |false |Enables a reuse container testcontainers feature.

|embedded.{module-name}.command |null |List of keywords which combines into command for container startup. Some modules ship container's commands by default, so resetting this value may lead to incorrect work of container.

|embedded.{module-name}.env |null |key-value map of additional environment variables. Where key is name of variable and value is actual value of it.

|embedded.{module-name}.filesToInclude | empty list a|List of files to include objects. Each object should have two parameters:

  • classpathResource (path to local file)
  • containerPath (path in a container to where file needs to be copied)

Example: [source,yaml]

embedded.redis.filesToInclude: classpathResource: "/my_local_file.txt" containerPath: "/etc/path_in_container.txt"

|===

== Supported services

=== link:embedded-mariadb/README.adoc[embedded-mariadb]

=== link:embedded-couchbase/README.adoc[embedded-couchbase]

=== link:embedded-kafka/README.adoc[embedded-kafka]

=== link:embedded-rabbitmq/README.adoc[embedded-rabbitmq]

=== link:embedded-aerospike/README.adoc[embedded-aerospike]

=== link:embedded-memsql/README.adoc[embedded-memsql]

=== link:embedded-redis/README.adoc[embedded-redis]

=== link:embedded-neo4j/README.adoc[embedded-neo4j]

=== link:embedded-postgresql/README.adoc[embedded-postgresql]

=== link:embedded-elasticsearch/README.adoc[embedded-elasticsearch]

=== link:embedded-dynamodb/README.adoc[embedded-dynamodb]

=== link:embedded-voltdb/README.adoc[embedded-voltdb]

=== link:embedded-minio/README.adoc[embedded-minio]

=== link:embedded-mongodb/README.adoc[embedded-mongodb]

=== link:embedded-google-pubsub/README.adoc[embedded-google-pubsub]

=== link:embedded-keycloak/README.adoc[embedded-keycloak]

=== link:embedded-influxdb/README.adoc[embedded-influxdb]

=== link:embedded-vault/README.adoc[embedded-vault]

=== link:embedded-oracle-xe/README.adoc[embedded-oracle-xe]

=== link:embedded-mysql/README.adoc[embedded-mysql]

=== link:embedded-localstack/README.adoc[embedded-localstack]

=== link:embedded-cassandra/README.adoc[embedded-cassandra]

=== link:embedded-clickhouse/README.adoc[embedded-clickhouse]

=== link:embedded-pulsar/README.adoc[embedded-pulsar]

== How to contribute

=== Flow

  • There are 2 branches in project: master and develop
  • You need to fork project and create branch from develop
  • You do not need to update project version in pom.xml files, this will be done by release job
  • Once finished - create pull request to develop from your fork, pass review and wait for merge
  • On release, ci job will merge develop into master and remove snapshot + publish artifacts into public maven repo

=== Checklist for contributing new module

  • Naming/formatting patterns match existing code
  • Test for success scenario
  • Test for negative scenario (autoconfiguration is disabled via properties). https://spring.io/blog/2018/03/07/testing-auto-configurations-with-spring-boot-2-0[How to test autoconfiguration]
  • Add new module to testcontainers-spring-boot-bom
  • Module provides documentation in README.adoc and this documentation is included in parent README.adoc (see an example in already existing modules). Documentation should include: ** maven module declaration ** consumed properties ** produced properties ** notes (if applicable) ** example of usage

== Release

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].