@@ -40,9 +40,17 @@ abstract class CommandBaseTest {
4040 protected static Network network = Network .newNetwork ();
4141
4242 @ Container
43- protected static final GenericContainer POSTGRES_CONTAINER = new GenericContainer ("postgres:16" ).withNetwork (network )
44- .withNetworkAliases ("postgres" ).withExposedPorts (5432 )
45- .withEnv (Map .of ("POSTGRES_DB" , "fineract-test" , "POSTGRES_USER" , "root" , "POSTGRES_PASSWORD" , "mifos" ));
43+ protected static final GenericContainer <?> POSTGRES_CONTAINER =
44+ new GenericContainer <>("postgres:16" )
45+ .withNetwork (network )
46+ .withNetworkAliases ("postgres" )
47+ .withExposedPorts (5432 )
48+ .withEnv (Map .of (
49+ "POSTGRES_DB" , "fineract-test" ,
50+ "POSTGRES_USER" , "root" ,
51+ "POSTGRES_PASSWORD" , "mifos" ,
52+ "TZ" , "UTC"
53+ ));
4654
4755 @ Autowired
4856 protected CommandRepository commandRepository ;
@@ -57,8 +65,16 @@ protected static void configure(DynamicPropertyRegistry registry) {
5765 registry .add ("spring.datasource.driver-class-name" , () -> "org.postgresql.Driver" );
5866 registry .add ("spring.datasource.username" , () -> "root" );
5967 registry .add ("spring.datasource.password" , () -> "mifos" );
60- registry .add ("spring.datasource.url" , () -> "jdbc:postgresql://" + POSTGRES_CONTAINER .getHost () + ":"
61- + POSTGRES_CONTAINER .getMappedPort (5432 ) + "/fineract-test" );
68+ registry .add ("spring.datasource.url" , () ->
69+ "jdbc:postgresql://" + POSTGRES_CONTAINER .getHost () + ":"
70+ + POSTGRES_CONTAINER .getMappedPort (5432 )
71+ + "/fineract-test?options=-c%20TimeZone=UTC"
72+ );
6273 registry .add ("spring.datasource.platform" , () -> "postgresql" );
74+
75+ registry .add (
76+ "spring.jpa.properties.hibernate.jdbc.time_zone" ,
77+ () -> "UTC"
78+ );
6379 }
6480}
0 commit comments