elasticsearch - 为什么弹性搜索 Junit 测试在 /tmp 文件夹中创建 jna 文件夹?
问题描述
我目前正在运行来自 maven spring boot 项目的弹性搜索 junit 集成测试。我可以看到它正在 /tmp/elasticsearch/jna 下创建一个文件夹。我怎样才能避免这种情况,以便在我的 Maven 项目目标/文件夹中创建它。
以下是我如何从我的 junit 测试创建弹性搜索实例的示例。
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PrimecastApp.class)
public class MessageHistoryReportingResourceIntTest
{
private static final String EMBEDDED_ELASTIC_SEARCH_DOWNLOAD_DIRECTORY = "./target/embeddedElasticSearch";
private static final String EMBEDDED_ELASTIC_SEARCH_INSTALLATION_DIRECTORY = "./target/embeddedElasticSearch";
@BeforeClass
public static void startElasticServer() throws Exception {
port = RandomUtil.getRandomNumberInRange(50000, 60000);
embeddedElastic = EmbeddedElastic.builder().withElasticVersion("6.6.1")
.withSetting(PopularProperties.HTTP_PORT, port)
.withSetting(PopularProperties.CLUSTER_NAME, "my_cluster").withStartTimeout(5, TimeUnit.MINUTES)
.withDownloadDirectory(new File(EMBEDDED_ELASTIC_SEARCH_DOWNLOAD_DIRECTORY))
.withInstallationDirectory(new File(EMBEDDED_ELASTIC_SEARCH_INSTALLATION_DIRECTORY))
.withCleanInstallationDirectoryOnStop(true)
.build().start();
}
}
}
我正在使用 allegro/embedded-elasticsearch 库
如果你能帮忙谢谢谢谢
解决方案
推荐阅读
- flutter - 如何从 JSON 响应 DART 返回前五个值
- regex - Bash 从 url github 提取项目名称
- azure-cosmosdb - 是否可以使用备份和/或恢复功能在新区域创建新帐户?
- logic - 带有 forall 语句的 Dafny 断言错误
- serialization - 在 C# 中使用 Newtonsoft 反序列化 JSON
- reactjs - II 应该如何在反应的父/子组件之间构建这个包?
- ios - SwiftUI 中的窗口是什么?
- java - 测试 Array 是否已排序或仅对其进行排序并从那里开始是否更有效?
- c# - C# WPF:调整绑定到目标的源值
- java - 修补 Java 类导入以使用不同的类