diff --git a/dev/build.example.testcontainers_fat/fat/src/com/ibm/ws/testcontainers/example/ProgrammaticImageTest.java b/dev/build.example.testcontainers_fat/fat/src/com/ibm/ws/testcontainers/example/ProgrammaticImageTest.java index 00322b162ce8..25d946e7f0c8 100644 --- a/dev/build.example.testcontainers_fat/fat/src/com/ibm/ws/testcontainers/example/ProgrammaticImageTest.java +++ b/dev/build.example.testcontainers_fat/fat/src/com/ibm/ws/testcontainers/example/ProgrammaticImageTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2024 IBM Corporation and others. + * Copyright (c) 2021, 2025 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -91,7 +91,7 @@ public class ProgrammaticImageTest { new ImageFromDockerfile().withDockerfileFromBuilder(builder -> builder.from(postgresql.asCanonicalNameString())// .copy("/docker-entrypoint-initdb.d/initDB.sql", "/docker-entrypoint-initdb.d/initDB.sql") .build()) - .withFileFromFile("/docker-entrypoint-initdb.d/initDB.sql", new File("lib/LibertyFATTestFiles/postgres/scripts/initDB.sql"), 644)) + .withFileFromFile("/docker-entrypoint-initdb.d/initDB.sql", new File("lib/LibertyFATTestFiles/postgres/initDB.sql"), 644)) .withExposedPorts(POSTGRE_PORT) .withEnv("POSTGRES_DB", POSTGRES_DB) .withEnv("POSTGRES_USER", POSTGRES_USER) diff --git a/dev/build.example.testcontainers_fat/publish/files/postgres/initDB.sql b/dev/build.example.testcontainers_fat/publish/files/postgres/initDB.sql new file mode 100644 index 000000000000..d9bbc96fca03 --- /dev/null +++ b/dev/build.example.testcontainers_fat/publish/files/postgres/initDB.sql @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS testtable; + +-- Create table +CREATE TABLE testtable ( + PersonID int, + LastName varchar(255), + FirstName varchar(255), + City varchar(255) +); + +-- Insert test data +INSERT INTO testtable (PersonID, LastName, FirstName, City) VALUES (1, 'Doe', 'John', 'Rochester'); \ No newline at end of file