Skip to content

Commit

Permalink
BindInNullPostgresTest: don't depend on method ordering, fix NPE if a…
Browse files Browse the repository at this point in the history
…ssumption fails
  • Loading branch information
Steven Schlansker committed Jan 21, 2017
1 parent 0827868 commit af01fff
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ public class BindInNullPostgresTest {
private static Handle handle;

@BeforeClass
public static void isPostgresInstalled() {
public static void init() {
assumeTrue(Boolean.parseBoolean(System.getenv("TRAVIS")));
}

@BeforeClass
public static void init() {
handle = new DBI("jdbc:postgresql:jdbi_test", "postgres", "").open();

handle.execute("create table something (id int primary key, name varchar(100))");
Expand All @@ -50,8 +47,10 @@ public static void init() {

@AfterClass
public static void exit() {
handle.execute("drop table something");
handle.close();
if (handle != null) {
handle.execute("drop table something");
handle.close();
}
}

@Test
Expand Down

0 comments on commit af01fff

Please sign in to comment.