Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void main(String[] args) throws InterruptedException {
.withUsername("test_user")
.withPassword("test_password")
.withDatabaseName("test_db")
.withPostgresVersion("17.4")
.withPostgresVersion("17.6.0")
.build()) {
final var pgUrl = clusterWrapper.getCommonUrlToPrimary();
log.info("pgUrl = {}", pgUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SimpleTest {
@Test
void testSimple() throws SQLException {
try (PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres").withTag("17.4"))
DockerImageName.parse("postgres").withTag("17.6"))
.withTmpFs(Collections.singletonMap("/var/lib/postgresql/data", "rw"))
.withDatabaseName("test_db")
.withUsername("test_user")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HikariDataSourceProviderTest {
@Test
void getDataSourceShouldSetDriverClassName() {
try (PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres").withTag("17.4"))
DockerImageName.parse("postgres").withTag("17.6"))
.withTmpFs(Collections.singletonMap("/var/lib/postgresql/data", "rw"))
.withDatabaseName("test_db")
.withUsername("test_user")
Expand Down
2 changes: 1 addition & 1 deletion internal-bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ javaPlatform {
dependencies {
api(platform("org.junit:junit-bom:5.13.4"))
api(platform("org.testcontainers:testcontainers-bom:1.21.3"))
api(platform("io.github.mfvanek:pg-index-health-bom:0.20.2"))
api(platform("io.github.mfvanek:pg-index-health-bom:0.30.0"))
api(platform("org.mockito:mockito-bom:5.20.0"))
api(platform("org.assertj:assertj-bom:3.27.6"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public PostgreSqlClusterWrapper clusterWrapper() {
.withUsername("test_user")
.withPassword("test_password")
.withDatabaseName("test_database")
.withPostgresVersion("17.4")
.withPostgresVersion("17.6.0")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import io.github.mfvanek.pg.core.checks.common.DatabaseCheckOnHost;
import io.github.mfvanek.pg.core.checks.common.Diagnostic;
import io.github.mfvanek.pg.model.column.Column;
import io.github.mfvanek.pg.model.column.ColumnWithType;
import io.github.mfvanek.pg.model.dbobject.DbObject;
import io.github.mfvanek.pg.model.table.Table;
import io.github.mfvanek.pg.testing.PostgreSqlClusterWrapper;
Expand Down Expand Up @@ -47,7 +49,7 @@ class DatabaseStructureStaticAnalysisTest {
void checkPostgresVersion() {
final String pgVersion = jdbcTemplate.queryForObject("select version();", String.class);
assertThat(pgVersion)
.startsWith("PostgreSQL 17.4");
.startsWith("PostgreSQL 17.6");
}

@Test
Expand All @@ -59,14 +61,20 @@ void databaseStructureCheckForPublicSchema() {
.filter(DatabaseCheckOnHost::isStatic)
.forEach(check -> {
final ListAssert<? extends DbObject> checkAssert = assertThat(check.check())
.as(check.getDiagnostic().name());
.as(check.getName());

switch (check.getDiagnostic()) {
case COLUMNS_WITH_FIXED_LENGTH_VARCHAR -> checkAssert.hasSize(2);
case COLUMNS_WITHOUT_DESCRIPTION -> checkAssert.hasSize(4);
case TABLES_NOT_LINKED_TO_OTHERS -> checkAssert.hasSize(1)
switch (check.getName()) {
case "COLUMNS_WITH_FIXED_LENGTH_VARCHAR" -> checkAssert.hasSize(2);
case "COLUMNS_WITHOUT_DESCRIPTION" -> checkAssert.hasSize(4);
case "TABLES_NOT_LINKED_TO_OTHERS", "TABLES_WHERE_PRIMARY_KEY_COLUMNS_NOT_FIRST" -> checkAssert.hasSize(1)
.asInstanceOf(list(Table.class))
.containsExactly(Table.of("employees"));
case "COLUMNS_WITH_TIMESTAMP_OR_TIMETZ_TYPE" -> checkAssert.hasSize(2)
.asInstanceOf(list(ColumnWithType.class))
.containsExactly(
ColumnWithType.ofTimestamp(Column.ofNotNull("employees", "created_at")),
ColumnWithType.ofTimestamp(Column.ofNullable("employees", "updated_at"))
);
default -> checkAssert.isEmpty();
}
});
Expand Down