Skip to content

Commit f9e8118

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into errorprone
2 parents cf29cda + 888e4e7 commit f9e8118

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

PgBulkInsert/pgbulkinsert-core/src/test/java/de/bytefish/pgbulkinsert/test/pgsql/handlers/HstoreExtensionTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
99
import org.checkerframework.checker.nullness.qual.Nullable;
1010
import org.junit.Assert;
11-
import org.junit.Ignore;
1211
import org.junit.Test;
1312

1413
import java.sql.ResultSet;
@@ -38,6 +37,7 @@ public void setCol_hstore(Map<String, String> col_hstore) {
3837

3938
@Override
4039
protected void onSetUpInTransaction() throws Exception {
40+
installExtension();
4141
createTable();
4242
}
4343

@@ -55,6 +55,14 @@ public HStoreEntityMapping() {
5555
}
5656
}
5757

58+
private boolean installExtension() throws SQLException {
59+
String sqlStatement = "CREATE EXTENSION IF NOT EXISTS hstore;";
60+
61+
Statement statement = connection.createStatement();
62+
63+
return statement.execute(sqlStatement);
64+
}
65+
5866
private boolean createTable() throws SQLException {
5967
String sqlStatement = String.format("CREATE TABLE %s.hstore_table(\n", schema) +
6068
" col_hstore hstore \n" +
@@ -66,7 +74,6 @@ private boolean createTable() throws SQLException {
6674
}
6775

6876
@Test
69-
@Ignore("This Test Requires the hstore extension to be enabled.")
7077
@SuppressWarnings("unchecked")
7178
public void saveAll_Hstore_Test() throws SQLException {
7279

@@ -96,7 +103,7 @@ public void saveAll_Hstore_Test() throws SQLException {
96103
Map<String, String> v = (Map<String,String>) rs.getObject("col_hstore");
97104

98105
Assert.assertEquals(1, v.size());
99-
Assert.assertEquals(true, v.containsKey("Philipp"));
106+
Assert.assertTrue(v.containsKey("Philipp"));
100107
Assert.assertEquals("Cool Cool Cool!", v.get("Philipp"));
101108
}
102109
}

PgBulkInsert/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
<maven.compiler.target>1.8</maven.compiler.target>
167167
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
168168

169-
<postgresql.version>42.2.9</postgresql.version>
169+
<postgresql.version>42.2.12</postgresql.version>
170170
<junit.version>4.13</junit.version>
171171
</properties>
172172

@@ -215,7 +215,7 @@
215215
<plugin>
216216
<groupId>org.apache.maven.plugins</groupId>
217217
<artifactId>maven-source-plugin</artifactId>
218-
<version>2.2.1</version>
218+
<version>3.2.1</version>
219219
<executions>
220220
<execution>
221221
<id>attach-sources</id>

0 commit comments

Comments
 (0)