-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#noissue] Replace embedded-elasticsearch with testcontainers-elastic…
…search
- Loading branch information
Showing
11 changed files
with
250 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...t/src/test/java/com/navercorp/pinpoint/plugin/elasticsearch/ESServerContainerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.navercorp.pinpoint.plugin.elasticsearch; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.testcontainers.containers.output.OutputFrame; | ||
import org.testcontainers.elasticsearch.ElasticsearchContainer; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public class ESServerContainerFactory { | ||
|
||
public static final int DEFAULT_PORT = 9200; | ||
|
||
public static ElasticsearchContainer newESServerContainerFactory(String loggerName) { | ||
ElasticsearchContainer elasticsearchContainer = new ElasticsearchContainer(); | ||
elasticsearchContainer.withLogConsumer(new Consumer<OutputFrame>() { | ||
private final Logger logger = LogManager.getLogger(loggerName); | ||
@Override | ||
public void accept(OutputFrame outputFrame) { | ||
logger.info(outputFrame.getUtf8String()); | ||
} | ||
}); | ||
return elasticsearchContainer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...t/src/test/java/com/navercorp/pinpoint/plugin/elasticsearch/ESServerContainerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.navercorp.pinpoint.plugin.elasticsearch; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.testcontainers.containers.output.OutputFrame; | ||
import org.testcontainers.elasticsearch.ElasticsearchContainer; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public class ESServerContainerFactory { | ||
|
||
public static final int DEFAULT_PORT = 9200; | ||
|
||
public static ElasticsearchContainer newESServerContainerFactory(String loggerName) { | ||
ElasticsearchContainer elasticsearchContainer = new ElasticsearchContainer(); | ||
elasticsearchContainer.withLogConsumer(new Consumer<OutputFrame>() { | ||
private final Logger logger = LogManager.getLogger(loggerName); | ||
@Override | ||
public void accept(OutputFrame outputFrame) { | ||
logger.info(outputFrame.getUtf8String()); | ||
} | ||
}); | ||
return elasticsearchContainer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.