use of org.folio.util.PostgresTester in project raml-module-builder by folio-org.
the class PostgresTesterContainerTest method testGetDoubleStart.
@Test
public void testGetDoubleStart() {
PostgresTester tester = new PostgresTesterContainer();
tester.start("db", "user", "pass");
String msg = "";
try {
tester.start("db", "user", "pass");
} catch (IllegalStateException e) {
msg = e.getMessage();
}
Assert.assertEquals("already started", msg);
tester.close();
}
use of org.folio.util.PostgresTester in project raml-module-builder by folio-org.
the class PostgresClientTest method closePostgresTester.
@Test
public void closePostgresTester() {
PostgresTester postgresTester1 = mock(PostgresTester.class);
PostgresTester postgresTester2 = mock(PostgresTester.class);
PostgresClient.setPostgresTester(postgresTester1);
PostgresClient.setPostgresTester(postgresTester1);
verify(postgresTester1, times(1)).close();
PostgresClient.setPostgresTester(postgresTester2);
verify(postgresTester1, times(2)).close();
PostgresClient.stopPostgresTester();
verify(postgresTester1, times(2)).close();
verify(postgresTester2, times(1)).close();
}
use of org.folio.util.PostgresTester in project raml-module-builder by folio-org.
the class PostgresTesterContainerTest method testStartClose.
@Test
public void testStartClose() {
PostgresTester tester = new PostgresTesterContainer();
Assert.assertFalse(tester.isStarted());
tester.start("db", "user", "pass");
Assert.assertTrue(tester.isStarted());
Assert.assertNotNull(tester.getHost());
Assert.assertTrue(tester.getPort() >= 1024);
tester.close();
Assert.assertFalse(tester.isStarted());
tester.close();
}
use of org.folio.util.PostgresTester in project raml-module-builder by folio-org.
the class PostgresTesterContainerTest method testBadDockerImage.
@Test(expected = IllegalStateException.class)
public void testBadDockerImage() {
PostgresTester tester = new PostgresTesterContainer("");
tester.start(null, null, null);
}
Aggregations