Skip to content

Commit 6e74226

Browse files
authored
Merge pull request #2 from Jarjanazy/fix-elasticsearch-container
fix elasticsearch container
2 parents a9406a9 + f477188 commit 6e74226

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@
7474
<dependency>
7575
<groupId>org.testcontainers</groupId>
7676
<artifactId>testcontainers</artifactId>
77-
<version>1.11.2</version>
77+
<version>1.17.3</version>
7878
</dependency>
7979
<dependency>
8080
<groupId>org.testcontainers</groupId>
8181
<artifactId>junit-jupiter</artifactId>
82-
<version>1.11.2</version>
82+
<version>1.17.2</version>
8383
<scope>test</scope>
8484
</dependency>
8585
<dependency>
8686
<groupId>org.testcontainers</groupId>
8787
<artifactId>elasticsearch</artifactId>
88-
<version>1.11.2</version>
88+
<version>1.17.3</version>
8989
<scope>test</scope>
9090
</dependency>
9191
</dependencies>

src/test/java/com/madadipouya/elasticsearch/springdata/BookElasticsearchContainer.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.madadipouya.elasticsearch.springdata;
22

33
import org.testcontainers.elasticsearch.ElasticsearchContainer;
4+
import org.testcontainers.utility.DockerImageName;
45

56
public class BookElasticsearchContainer extends ElasticsearchContainer {
67

@@ -11,7 +12,8 @@ public class BookElasticsearchContainer extends ElasticsearchContainer {
1112
private static final String ELASTIC_SEARCH = "elasticsearch";
1213

1314
public BookElasticsearchContainer() {
14-
super(ELASTIC_SEARCH_DOCKER);
15+
super(DockerImageName.parse(ELASTIC_SEARCH_DOCKER)
16+
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"));
1517
this.addFixedExposedPort(9200, 9200);
1618
this.addFixedExposedPort(9300, 9300);
1719
this.addEnv(CLUSTER_NAME, ELASTIC_SEARCH);

0 commit comments

Comments
 (0)