Commit Graph

255 Commits

Author SHA1 Message Date
Andy Wilkinson 08b358e829 Merge branch '3.3.x' into 3.4.x
Closes gh-44694
2025-03-12 12:50:18 +00:00
Andy Wilkinson 3a6e4e9e58 Add checks for factories files
META-INF/spring.factories and META-INF/spring/aot.factories in the
main source set are now checked. The checks verify that:

- Each class listed in the values exists in the source set's output
- The classes are listed alphabetically
- Nested classes are identified using their binary name

Closes gh-44676
2025-03-12 12:44:18 +00:00
Eddú Meléndez 261ea64e39 Add ServiceConnection support for LLdapContainer (Testcontainers)
See gh-44389

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2025-02-28 13:54:55 +01:00
Andy Wilkinson 93648792b1 Switch to management.opentelemetry.resource-attributes in tests
See gh-44468
2025-02-27 20:21:47 +00:00
Moritz Halbritter dae891f473 Add SSL service connection support for Kafka
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter 789d30deab Add SSL service connection support for ElasticSearch
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter 7cf9cc74a2 Add SSL service connection support for Redis
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter 109fd6f97d Add SSL service connection support for MongoDB
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter 0ccf1b81d8 Add SSL service connection support for Couchbase
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter 9c520d6af7 Add SSL service connection support for Cassandra
See gh-41137
2025-02-17 13:23:16 +01:00
Moritz Halbritter e26ccbe028 Add SSL service connection support for AMQP
See gh-41137
2025-02-17 13:23:15 +01:00
Moritz Halbritter b62a0c1ae0 Add SSL support to Docker Compose and Testcontainers infrastructure
See gh-41137

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2025-02-17 13:23:15 +01:00
Dmytro Nosan ed5100ecee Upgrade to Elasticsearch Client 8.17.0
See gh-44100

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-02-08 10:04:00 +00:00
Phillip Webb 3ff6e0b5a9 Merge branch '3.4.x' 2025-01-24 19:24:42 -08:00
Phillip Webb 3b29085ac8 Merge branch '3.3.x' into 3.4.x 2025-01-24 19:24:10 -08:00
Phillip Webb 66c224b74a Update copyright year of changed files 2025-01-24 19:23:41 -08:00
Andy Wilkinson 1e43b0003f Merge branch '3.4.x'
Closes gh-43951
2025-01-24 08:54:50 +00:00
Andy Wilkinson c7b54dcbb3 Merge branch '3.3.x' into 3.4.x
Closes gh-43950
2025-01-24 08:53:03 +00:00
Johnny Lim 6c8d41935f Polish
See gh-43879

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-01-24 08:45:41 +00:00
Phillip Webb a49719d73e Use consistent exception messages in Assert calls
Update `Assert` calls to consistently use messages of the form
"'item' must [not] ...".

Closes gh-43780
2025-01-11 21:18:47 -08:00
Phillip Webb ccc1b5da28 Don't call `Startable.start()` for already started containers
Add a new `TestcontainersStartup.start` static method and update the
existing start methods so that `Startable.start()` is only called when
the container is not already running.

Prior to this commit, we assumed that `Startable.start()` calls were
idempotent and could be safely made multiple times. Whilst this appears
to be true for stock `GenericContainer` based startables, users may have
their own `start()` method that does not expect to be called multiple
times.

The implemented detection logic will not be applied if a `Startable`
is not also a `Container`. In these cases, the implementation will need
to deal directly with multiple `start()` calls.

Fixed gh-43253
2024-12-12 15:26:59 -08:00
Phillip Webb 6155735ac5 Merge branch '3.3.x'
Closes gh-43370
2024-12-03 19:07:55 -08:00
Phillip Webb 4265a0bcc2 Reset `Startables` COUNTER when testing parallel startup
Closes gh-43369
2024-12-03 19:07:16 -08:00
Johnny Lim 859c235a95 Polish
See gh-43316
2024-11-29 10:35:11 +01:00
Dmytro Nosan 5be0049ed9 Add a test to verify that ReflectionHint for Hazelcast ClientConfig is present
See gh-42874
2024-10-25 08:44:26 +02:00
Eddú Meléndez d9dfb0389e Add container support for ClickHouse
See gh-42837
2024-10-23 13:54:58 +02:00
Stéphane Nicoll b7979cf443 Use AbstractAotProcessor.AOT_PROCESSING instead of duplicate constant
Closes gh-42461
2024-10-18 10:12:01 +02:00
Phillip Webb 465e909974 Merge branch '3.3.x' 2024-10-16 13:09:09 -07:00
Stéphane Nicoll e0152097f3 Polish "Upgrade to Testcontainers 1.20.2"
This commit review the original upgrade to retain compatiblity with the
deprecated Cassandra and ConfluentKafka containers.

This commit also fixes the SSL Cassandra tests. The new container uses
a custom wait strategy that uses plain text and does not work with an
SSL container.

Closes gh-42670

Co-authored-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
2024-10-15 14:45:15 +02:00
Stéphane Nicoll a40ae49a76 Upgrade to Testcontainers 1.20.2
Closes gh-42670
2024-10-14 16:25:57 +02:00
Andy Wilkinson 3c095b4ec2 Prefer DynamicPropertyRegistar to DynamicPropertyRegistry
Closes gh-41996
2024-10-10 15:25:44 +01:00
Moritz Halbritter e6165b0311 Add transport and connect timeout properties for OTLP logging
Closes gh-42528
Closes gh-42527
2024-10-08 16:01:09 +02:00
Moritz Halbritter 40bb81419d Rename OtlpAutoConfiguration to OtlpTracingAutoConfiguration
Closes gh-42529
2024-10-08 15:56:18 +02:00
Johnny Lim 1585c5a109 Polish
See gh-42503
2024-10-03 07:33:40 +02:00
Moritz Halbritter 33def6d6b4 Polish "Add service connection support for Hazelcast"
See gh-42416
2024-09-26 16:45:26 +02:00
Dmytro Nosan cee7439dbe Add service connection support for Hazelcast
See gh-42416
2024-09-26 14:34:12 +02:00
Phillip Webb 7b3077280c Merge branch '3.3.x'
Closes gh-42441
2024-09-24 14:32:48 -07:00
Phillip Webb 100bedc07d Merge branch '3.2.x' into 3.3.x
Closes gh-42440
2024-09-24 14:29:09 -07:00
Phillip Webb ad72411e2b Apply conventions plugin to all subprojects
Closes gh-42438
2024-09-24 14:26:32 -07:00
Andy Wilkinson d380ada4b2 Merge branch '3.3.x'
Closes gh-42387
2024-09-19 19:06:23 +01:00
Andy Wilkinson 70d2907351 Merge branch '3.2.x' into 3.3.x
Closes gh-42386
2024-09-19 19:06:12 +01:00
Andy Wilkinson 319e33f786 Make a single scrape attempt, protected by Awaitility
Using a single scrape attempt that is protected by Awaitility should
protect against instability of the OpenTelemetry Collector instance
running in the container and will hopefully stabilize the test.

This commit has also increased the timeout for a successful response
to 30 seconds and removed the configuration of the configuration of
the polling delay and interval as the values being set were the same
as the defaults.

Closes gh-42377
2024-09-19 19:06:05 +01:00
Johnny Lim a0d1c10d8a Polish
See gh-42340
2024-09-18 11:19:59 +02:00
Andy Wilkinson 2bfd784d7b Revert "Prevent duplicate DynamicPropertyRegistry beans"
This partially reverts commit 4d4b189cce.
The changes to main code are no longer needed as Framework's test
context framework no longer defines a DynamicPropertyRegistry bean. The
changes to test code have been kept to verify that @SpringBootTest and
TestcontainersPropertySourceAutoConfiguration continue to work in
combination.

Closes gh-42275
2024-09-12 08:20:27 +01:00
Phillip Webb 8628f7334f Ensure `@AutoConfigureTestDatabase` does not replace test databases
Update `@AutoConfigureTestDatabase` support so that by default test
databases are not replaced.

Fixes gh-35253
2024-09-11 21:01:54 -07:00
Eddú Meléndez 793e9a8795 Add OpenTelemetry Logging Service Connection from LgtmStackContainer and Docker Compose
See gh-42174
2024-09-09 08:37:39 +02:00
Moritz Halbritter 861e5209ef Add transport selection to OtlpLoggingConnectionDetails
Closes gh-42171
2024-09-06 14:26:03 +02:00
Moritz Halbritter bac330354b Polish "Support Otlp Tracing's GRPC port from service connections"
See gh-41333
2024-09-06 13:18:26 +02:00
Eddú Meléndez 7baa553760 Support Otlp Tracing's GRPC port from service connections
Otlp Tracing's exporter is configured using Transport. Current support
for service connections read the mapped port for HTTP transport 4318.
This commits adds support to read port for GRPC transport 4317.

See gh-41333
2024-09-06 13:18:26 +02:00
Moritz Halbritter 8fc1bca56c Polish "Add service connection from Opentelemetry Collector for Logging"
See gh-41324
2024-09-06 10:20:41 +02:00
Eddú Meléndez 7adf843bfd Add service connection from Opentelemetry Collector for Logging
Adds ConnectionDetails from Docker Compose and Testcontainers.

See gh-41324
2024-09-06 10:10:17 +02:00
Andy Wilkinson f7ba5f1bbc Polish support for Testcontainers Redis
- Add support for RedisStackContainer
- Update the docs

Closes gh-41450
2024-09-05 14:25:51 +01:00
Phillip Webb fa686bb593 Support Testcontainer Redis with custom image names
Update `RedisContainerConnectionDetailsFactory` so that it can also
support `RedisContainer` with a custom name.

Closes gh-41450
2024-08-29 19:26:20 -07:00
Scott Frederick e7faca3bbb Add support for Testcontainer Redis
Add support for the official `com.redis:testcontainers-redis` container.

See gh-41450
2024-08-29 19:23:40 -07:00
Phillip Webb 4d4b189cce Prevent duplicate DynamicPropertyRegistry beans
Remove the Spring Framework registered `DynamicPropertyRegistry` when
using Testcontainers.

See gh-41839
2024-08-21 21:04:13 -07:00
Andy Wilkinson d56dd741d0 Merge branch '3.3.x'
Closes gh-41860
2024-08-14 19:04:18 +01:00
Andy Wilkinson 1bd9948485 Merge branch '3.2.x' into 3.3.x
Closes gh-41859
2024-08-14 19:03:52 +01:00
Andy Wilkinson e7e5ed1508 Don't initialize containers during AOT processing
Fixes gh-41838
2024-08-14 18:56:00 +01:00
Moritz Halbritter 46150bae89 Merge branch '3.3.x'
Closes gh-41858
2024-08-14 17:20:59 +02:00
Moritz Halbritter 2a84fe5760 Merge branch '3.2.x' into 3.3.x
Closes gh-41857
2024-08-14 16:47:52 +02:00
Moritz Halbritter 1d45016d8c Upgrade to spring-javaformat 0.0.43
Closes gh-41853
2024-08-14 16:32:41 +02:00
Nikola Kološnjaji 2a123b3e27 Fix typo in Grafana ConnectionDetailsFactory javadoc
See gh-41705
2024-08-06 16:47:48 -05:00
Stéphane Nicoll dabc83338b Polish "Add support for Grafana LGTM stack"
See gh-41551
2024-07-29 10:43:56 +02:00
Eddú Meléndez 9eff627eb2 Add support for Grafana LGTM stack
See gh-41551
2024-07-29 10:33:08 +02:00
Andy Wilkinson e201b94d4f Merge branch '3.3.x'
Closes gh-41616
2024-07-25 16:17:52 +01:00
Andy Wilkinson c642f6d268 Merge branch '3.2.x' into 3.3.x
Closes gh-41613
2024-07-25 16:16:35 +01:00
Phillip Webb 000600c68a Merge branch '3.3.x' 2024-07-22 18:41:53 +01:00
Andy Wilkinson 46ec3e3a07 Polish "Support service connections for redis-stack and redis-stack-server"
See gh-41327
2024-07-17 11:08:52 +01:00
Eddú Meléndez 2634d0c6b1 Support service connections for redis-stack and redis-stack-server
See gh-41327
2024-07-17 10:54:06 +01:00
Andy Wilkinson 2216b48e64 Match one of multiple names in ContainerConnectionDetailsFactory
Closes gh-41543

Co-Authored-By: Eddú Meléndez <eddu.melendez@gmail.com>
2024-07-17 10:43:50 +01:00
Andy Wilkinson 375b3b16a0 Remove APIs that were deprecated for removal in 3.4.0
Closes gh-41435
2024-07-10 13:31:21 +01:00
Andy Wilkinson 6749ad674f Polish "Add support for org.testcontainers.kafka.KafkaContainer"
See gh-40695
2024-06-27 15:10:58 +01:00
Eddú Meléndez 769f3e9d14 Add support for org.testcontainers.kafka.KafkaContainer
Testcontainers 1.19.8 provides `org.testcontainers.kafka.KafkaContainer`,
which relies on `apache/kafka` image.

See gh-40695
2024-06-27 14:58:57 +01:00
Andy Wilkinson b0d4f1d356 Merge branch '3.2.x' into 3.3.x
Closes gh-41257
2024-06-27 10:16:36 +01:00
Andy Wilkinson 654016af7f Move Docker-related test support into a separate module
See gh-41228
2024-06-26 19:47:35 +01:00
Andy Wilkinson 6fbf08fa9a Update spring-boot-docker-compose to use docker-test plugin
See gh-41228
2024-06-26 19:46:03 +01:00
Andy Wilkinson 3f1f801461 Update spring-boot-testcontainers to use docker-test plugin
See gh-41228
2024-06-26 19:45:52 +01:00
Phillip Webb 26ea4f9fb1 Merge branch '3.2.x' into 3.3.x 2024-06-25 22:16:10 -07:00
Phillip Webb 712d935c8e Fix checkstyle violation
See gh-35786
2024-06-25 22:16:03 -07:00
Phillip Webb 87e0262896 Merge branch '3.2.x' into 3.3.x
Closes gh-41238
2024-06-25 22:08:44 -07:00
Phillip Webb eef4c3c2c0 Allow TestcontainersLifecycleBeanPostProcessor to detect scoped beans
Update `TestcontainersLifecycleBeanPostProcessor` so that scoped beans
are included.

Fixes gh-35786
2024-06-25 22:00:34 -07:00
Phillip Webb 905d6b96d0 Merge branch '3.2.x'
Closes gh-41166
2024-06-19 22:30:58 -07:00
Andy Wilkinson 491f34d25c Improve container test code
Replace `DockerImageNames` with a enum and relocate it from the
`testcontainers` to `container` package. The enum now also
becomes a common location that we can use to apply container
configuration such as timeouts.

Closes gh-41164

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2024-06-19 20:10:03 -07:00
Andy Wilkinson e10066a83f Merge branch '3.2.x'
Closes gh-41125
2024-06-17 11:43:29 +01:00
Andy Wilkinson 138307c13c Disable test context cache in spring-boot-testcontainers
Closes gh-41124
2024-06-17 11:43:00 +01:00
Phillip Webb 147240aa0c Merge branch '3.2.x'
Closes gh-41080
2024-06-11 13:32:30 -07:00
Ahmed Ashour 207327d97c Use method references when possible in test code
See gh-40974
2024-06-11 12:58:00 -07:00
Phillip Webb 255bcc28e6 Merge branch '3.2.x'
Closes gh-41077
2024-06-11 10:48:52 -07:00
Phillip Webb ecc9a2352d Polish "Use constructor rather than Collection.addAll"
See gh-41053
2024-06-11 10:02:27 -07:00
Piyal Ahmed 17adcfc180 Use constructor rather than Collection.addAll
See gh-41053
2024-06-11 09:39:45 -07:00
Andy Wilkinson d05d0105db Merge branch '3.2.x' 2024-05-22 17:02:37 +01:00
Andy Wilkinson 35fb54a4d3 Polish deprecation notice 2024-05-22 17:02:29 +01:00
Andy Wilkinson 7bec440d03 Merge branch '3.2.x' 2024-05-22 09:58:37 +01:00
Andy Wilkinson d340f87c22 Disable test when Docker is not available
See gh-40585
2024-05-22 09:58:23 +01:00
Andy Wilkinson 2d979bf06e Merge branch '3.2.x'
Closes gh-40863
2024-05-22 09:16:57 +01:00
Andy Wilkinson 468e246dbb Make sure container's started before connection details use it
Prior to this commit, a Testcontainer that was managed as a bean
would not have been started in time if it was accessed before
the bean factory's configuration had been frozen. A common way
for this to occur is when using JPA. The entity manager factory
bean is LoadTimeWeaverAware which causes it to be created before
configuration is frozen. Creating this bean requires the DataSource
which in turn requires the JdbcConnectionDetails and its JDBC URL.
Getting the JDBC URL From the connection details requires the
container hosting the SQL database to have been started.

This commit updates ContainerConnectionDetails, the super-class for
all Testcontainer-based ConnectionDetails implementations, to publish
an event when the Container is retrieved from the details. When this
event is published, TestcontainersLifecycleBeanPostProcessor
initializes all containers that are defined as beans.

Closes gh-40585
2024-05-22 09:15:21 +01:00
Andy Wilkinson 8b3c808ae6 Polish 2024-05-20 15:08:45 +01:00
Andy Wilkinson 921e459eb5 Merge branch '3.2.x'
Closes gh-40835
2024-05-20 13:12:22 +01:00
Andy Wilkinson f440f2c3ac Merge branch '3.1.x' into 3.2.x
Closes gh-40834
2024-05-20 13:12:03 +01:00
Andy Wilkinson f5262d89df Add missing Testcontainers service connection tests
Closes gh-35039
2024-05-20 13:02:24 +01:00