I am unable to find my resource map when using Test Containers, in Postgres version. I am trying something like it:
private static PostgreSQLContainer postgresqlContainer = new PostgreSQLContainer("postgres")
.withDatabaseName(DATABASE_NAME)
.withUsername(USER)
.withPassword(PASSWORD);
@ClassRule
@BeforeAll
public static void initContainer() {
postgresqlContainer.withExposedPorts(5432);
postgresqlContainer.withClasspathResourceMapping("../../../../../../../create.sh",
"/docker-entrypoint-initdb.d/00_create.sh",
BindMode.READ_ONLY);
postgresqlContainer.start();
}
However, I can't find the file. I even tried to include the script create.sh in the same directory, but it can't be found:
java.lang.IllegalArgumentException: Resource with path ../../../../../../../create.sh could not be found on any of these classloaders
Project Structure
Anyone with the same issue?