Skip to content

Commit 7d3c7be

Browse files
committed
Update PostgreSQL
1 parent 5f36f39 commit 7d3c7be

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ ext {
5353
[name: 'no_sb', liquibase: 'default']
5454
]],
5555
[name: 'postgres', versions: [
56-
[name: '12', postgres: '12.18', 'zonky-postgres': '12.18.0', opentable: 'default', yandex: 'default'],
57-
[name: '13', postgres: '13.14', 'zonky-postgres': '13.14.0', opentable: 'default', yandex: 'default'],
58-
[name: '14', postgres: '14.11', 'zonky-postgres': '14.11.0', opentable: 'default', yandex: 'default'],
59-
[name: '15', postgres: '15.6', 'zonky-postgres': '15.6.0', opentable: 'default', yandex: 'default'],
56+
[name: '12', postgres: '12.20', 'zonky-postgres': '12.20.0', opentable: 'default', yandex: 'default'],
57+
[name: '13', postgres: '13.16', 'zonky-postgres': '13.16.0', opentable: 'default', yandex: 'default'],
58+
[name: '14', postgres: '14.13', 'zonky-postgres': '14.13.0', opentable: 'default', yandex: 'default'],
59+
[name: '15', postgres: '15.8', 'zonky-postgres': '15.8.0', opentable: 'default', yandex: 'default'],
6060
[name: '16', postgres: '16.4', 'zonky-postgres': '16.4.0', opentable: 'default', yandex: 'default']
6161
]],
6262
[name: 'mssql', versions: [
@@ -296,6 +296,9 @@ project(':embedded-database-spring-test') {
296296
testImplementation 'org.mockito:mockito-core:3.12.4' // 4.11.0 is Java 8
297297
testImplementation 'org.assertj:assertj-core:3.26.3'
298298
testImplementation 'com.zaxxer:HikariCP:4.0.3' // 4.0 is Java 8
299+
300+
// Test with latest Postgres
301+
implementation platform('io.zonky.test.postgres:embedded-postgres-binaries-bom:16.4.0')
299302
}
300303

301304
configurations {

embedded-database-spring-test/src/test/java/io/zonky/test/db/config/ConfigurationPropertiesIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void testConfigurationProperties() throws Exception {
5151

5252
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
5353

54-
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname='test'", String.class);
54+
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname NOT IN('template0', 'template1', 'postgres') LIMIT 1", String.class);
5555
assertThat(collate).isEqualTo("cs_CZ.UTF-8");
5656

5757
String maxConnections = jdbcTemplate.queryForObject("show max_connections", String.class);

embedded-database-spring-test/src/test/java/io/zonky/test/db/provider/postgres/DockerPostgresDatabaseProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void testConfigurationProperties() throws Exception {
145145
String postgresVersion = jdbcTemplate.queryForObject("show server_version", String.class);
146146
assertThat(postgresVersion).startsWith("16");
147147

148-
String collate = jdbcTemplate.queryForObject("select datcollate from pg_database WHERE datname='test';", String.class);
148+
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname NOT IN('template0', 'template1', 'postgres') LIMIT 1;", String.class);
149149
assertThat(collate).isEqualTo("cs_CZ.UTF-8");
150150

151151
String maxConnections = jdbcTemplate.queryForObject("show max_connections", String.class);

embedded-database-spring-test/src/test/java/io/zonky/test/db/provider/postgres/OpenTablePostgresDatabaseProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void testConfigurationProperties() throws Exception {
119119

120120
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
121121

122-
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname='test'", String.class);
122+
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname NOT IN('template0', 'template1', 'postgres') LIMIT 1", String.class);
123123
assertThat(collate).isEqualTo("cs_CZ.UTF-8");
124124

125125
String maxConnections = jdbcTemplate.queryForObject("show max_connections", String.class);

embedded-database-spring-test/src/test/java/io/zonky/test/db/provider/postgres/YandexPostgresDatabaseProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void testConfigurationProperties() throws Exception {
9494
String postgresVersion = jdbcTemplate.queryForObject("show server_version", String.class);
9595
assertThat(postgresVersion).startsWith("10.");
9696

97-
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname='test'", String.class);
97+
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname NOT IN('template0', 'template1', 'postgres') LIMIT 1", String.class);
9898
assertThat(collate).isEqualTo("cs_CZ.UTF-8");
9999

100100
String maxConnections = jdbcTemplate.queryForObject("show max_connections", String.class);

embedded-database-spring-test/src/test/java/io/zonky/test/db/provider/postgres/ZonkyPostgresDatabaseProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void testConfigurationProperties() throws Exception {
119119

120120
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
121121

122-
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname='test'", String.class);
122+
String collate = jdbcTemplate.queryForObject("SELECT datcollate FROM pg_database WHERE datname NOT IN('template0', 'template1', 'postgres') LIMIT 1", String.class);
123123
assertThat(collate).isEqualTo("cs_CZ.UTF-8");
124124

125125
String maxConnections = jdbcTemplate.queryForObject("show max_connections", String.class);

0 commit comments

Comments
 (0)