Skip to content

Commit

Permalink
Merge pull request #2 from Jarjanazy/fix-elasticsearch-container
Browse files Browse the repository at this point in the history
fix elasticsearch container
  • Loading branch information
kasramp authored Aug 2, 2022
2 parents a9406a9 + f477188 commit 6e74226
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.11.2</version>
<version>1.17.3</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.11.2</version>
<version>1.17.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.11.2</version>
<version>1.17.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.madadipouya.elasticsearch.springdata;

import org.testcontainers.elasticsearch.ElasticsearchContainer;
import org.testcontainers.utility.DockerImageName;

public class BookElasticsearchContainer extends ElasticsearchContainer {

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

public BookElasticsearchContainer() {
super(ELASTIC_SEARCH_DOCKER);
super(DockerImageName.parse(ELASTIC_SEARCH_DOCKER)
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"));
this.addFixedExposedPort(9200, 9200);
this.addFixedExposedPort(9300, 9300);
this.addEnv(CLUSTER_NAME, ELASTIC_SEARCH);
Expand Down

0 comments on commit 6e74226

Please sign in to comment.