-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Pg11 support in unit tests (#7)
* Added Pg11 into unit testing * Code cleanup and transactions * Added some tests to improve coverage
- Loading branch information
Showing
16 changed files
with
324 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/test/java/com/mfvanek/pg/index/health/IndexesHealthImplTestPg10.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2019. Ivan Vakhrushev. All rights reserved. | ||
* https://github.com/mfvanek | ||
*/ | ||
|
||
package com.mfvanek.pg.index.health; | ||
|
||
import com.opentable.db.postgres.junit5.EmbeddedPostgresExtension; | ||
import com.opentable.db.postgres.junit5.PreparedDbExtension; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.sql.SQLException; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
class IndexesHealthImplTestPg10 extends IndexesHealthImplTestBase { | ||
|
||
@RegisterExtension | ||
static final PreparedDbExtension embeddedPostgres = | ||
EmbeddedPostgresExtension.preparedDatabase(ds -> { | ||
}); | ||
|
||
IndexesHealthImplTestPg10() { | ||
super(embeddedPostgres.getTestDatabase()); | ||
} | ||
|
||
@Test | ||
void pgVersion() throws SQLException { | ||
try (var databasePopulator = createDatabasePopulator()) { | ||
assertThat(databasePopulator.getPgVersion(), containsString("PostgreSQL 10.6")); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/test/java/com/mfvanek/pg/index/health/IndexesHealthImplTestPg11.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2019. Ivan Vakhrushev. All rights reserved. | ||
* https://github.com/mfvanek | ||
*/ | ||
|
||
package com.mfvanek.pg.index.health; | ||
|
||
import io.zonky.test.db.postgres.junit5.EmbeddedPostgresExtension; | ||
import io.zonky.test.db.postgres.junit5.PreparedDbExtension; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.sql.SQLException; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
class IndexesHealthImplTestPg11 extends IndexesHealthImplTestBase { | ||
|
||
@RegisterExtension | ||
static final PreparedDbExtension embeddedPostgres = | ||
EmbeddedPostgresExtension.preparedDatabase(ds -> { | ||
}); | ||
|
||
IndexesHealthImplTestPg11() { | ||
super(embeddedPostgres.getTestDatabase()); | ||
} | ||
|
||
@Test | ||
void pgVersion() throws SQLException { | ||
try (var databasePopulator = createDatabasePopulator()) { | ||
assertThat(databasePopulator.getPgVersion(), containsString("PostgreSQL 11.5")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.