Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5123eb0c
Commit
5123eb0c
authored
Nov 10, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation in Testcontainers 1.15.0
See gh-24103
parent
c1a1b5fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
8 deletions
+43
-8
CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java
...figurationWithPasswordAuthenticationIntegrationTests.java
+3
-4
CassandraDataAutoConfigurationIntegrationTests.java
...andra/CassandraDataAutoConfigurationIntegrationTests.java
+2
-2
build.gradle
...t/spring-boot-tools/spring-boot-test-support/build.gradle
+1
-0
CassandraContainer.java
...k/boot/testsupport/testcontainers/CassandraContainer.java
+34
-0
VersionOverridingElasticsearchContainer.java
...stcontainers/VersionOverridingElasticsearchContainer.java
+3
-2
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java
View file @
5123eb0c
...
...
@@ -28,7 +28,6 @@ import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import
org.junit.jupiter.api.Test
;
import
org.rnorth.ducttape.TimeoutException
;
import
org.rnorth.ducttape.unreliables.Unreliables
;
import
org.testcontainers.containers.CassandraContainer
;
import
org.testcontainers.containers.ContainerLaunchException
;
import
org.testcontainers.containers.wait.strategy.AbstractWaitStrategy
;
import
org.testcontainers.images.builder.Transferable
;
...
...
@@ -37,6 +36,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.testsupport.testcontainers.CassandraContainer
;
import
org.springframework.util.StreamUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
class
CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests
{
@Container
static
final
CassandraContainer
<?>
cassandra
=
new
PasswordAuthenticatorCassandraContainer
().
withStartupAttempts
(
5
)
static
final
CassandraContainer
cassandra
=
new
PasswordAuthenticatorCassandraContainer
().
withStartupAttempts
(
5
)
.
withStartupTimeout
(
Duration
.
ofMinutes
(
10
)).
waitingFor
(
new
CassandraWaitStrategy
());
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
...
...
@@ -80,8 +80,7 @@ class CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests {
.
hasMessageContaining
(
"Authentication error"
));
}
static
final
class
PasswordAuthenticatorCassandraContainer
extends
CassandraContainer
<
PasswordAuthenticatorCassandraContainer
>
{
static
final
class
PasswordAuthenticatorCassandraContainer
extends
CassandraContainer
{
@Override
protected
void
containerIsCreated
(
String
containerId
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationIntegrationTests.java
View file @
5123eb0c
...
...
@@ -21,7 +21,6 @@ import java.time.Duration;
import
com.datastax.oss.driver.api.core.CqlSession
;
import
com.datastax.oss.driver.api.core.CqlSessionBuilder
;
import
org.junit.jupiter.api.Test
;
import
org.testcontainers.containers.CassandraContainer
;
import
org.testcontainers.junit.jupiter.Container
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
...
...
@@ -31,6 +30,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.cassandra.city.City
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.testsupport.testcontainers.CassandraContainer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.cassandra.config.SchemaAction
;
...
...
@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class
CassandraDataAutoConfigurationIntegrationTests
{
@Container
static
final
CassandraContainer
<?>
cassandra
=
new
CassandraContainer
<>
().
withStartupAttempts
(
5
)
static
final
CassandraContainer
cassandra
=
new
CassandraContainer
().
withStartupAttempts
(
5
)
.
withStartupTimeout
(
Duration
.
ofMinutes
(
10
));
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/build.gradle
View file @
5123eb0c
...
...
@@ -18,6 +18,7 @@ dependencies {
compileOnly
(
"org.neo4j:neo4j-ogm-core"
)
compileOnly
(
"org.springframework:spring-context"
)
compileOnly
(
"org.springframework.data:spring-data-redis"
)
compileOnly
(
"org.testcontainers:cassandra"
)
compileOnly
(
"org.testcontainers:elasticsearch"
)
compileOnly
(
"org.testcontainers:testcontainers"
)
...
...
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/CassandraContainer.java
0 → 100644
View file @
5123eb0c
/*
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
testsupport
.
testcontainers
;
import
org.testcontainers.utility.DockerImageName
;
/**
* Extension of {@link org.testcontainers.containers.CassandraContainer} that provides a
* default version.
*
* @author Stephane Nicoll
* @since 2.3.6
*/
public
class
CassandraContainer
extends
org
.
testcontainers
.
containers
.
CassandraContainer
<
CassandraContainer
>
{
public
CassandraContainer
()
{
super
(
DockerImageName
.
parse
(
"cassandra"
).
withTag
(
"3.11.2"
));
}
}
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/VersionOverridingElasticsearchContainer.java
View file @
5123eb0c
...
...
@@ -22,16 +22,17 @@ import org.testcontainers.elasticsearch.ElasticsearchContainer;
* Extension of {@link ElasticsearchContainer} to override default version.
*
* @author Scott Frederick
* @since 2.3.6
*/
public
class
VersionOverridingElasticsearchContainer
extends
ElasticsearchContainer
{
/**
* Elasticsearch Docker base URL
* Elasticsearch Docker base URL
.
*/
private
static
final
String
ELASTICSEARCH_IMAGE
=
"docker.elastic.co/elasticsearch/elasticsearch"
;
/**
* Elasticsearch version
* Elasticsearch version
.
*/
protected
static
final
String
ELASTICSEARCH_VERSION
=
Version
.
CURRENT
.
toString
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment