首页 > 解决方案 > 测试容器:FileNotFoundException:.testcontainers.properties

问题描述

我在我的机器上运行我的应用程序的集成测试(使用JUnit5)时遇到问题。我的测试依赖于两个容器,我使用Testcontainers java library:和. 版本是.micronautWindows 10 ProRabbitMQMS SQL serverDockerv19.03.13

在运行集成测试时,我收到以下异常:

[WARN ][DESKTOP-PBCHP60] [testcontainers.utility.TestcontainersConfiguration] – Attempted to read Testcontainers configuration file at file:/$HOME.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: $HOME\.testcontainers.properties (The system cannot find the file specified)

macOS虽然,从机器运行测试时我没有得到这个异常。我的假设是它是Windows具体的。

谁能告诉我如何解决它?我应该自己创建所需的文件吗?或者也许有一种方法可以在运行 IT 期间跳过读取此文件的步骤?

标签: dockermicronauttestcontainerstestcontainers-junit5

解决方案


推荐阅读