Search in sources :

Example 1 with PostgresTester

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();
}
Also used : PostgresTester(org.folio.util.PostgresTester) Test(org.junit.Test)

Example 2 with PostgresTester

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();
}
Also used : PostgresTester(org.folio.util.PostgresTester) AESTest(org.folio.rest.security.AESTest) Test(org.junit.Test)

Example 3 with PostgresTester

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();
}
Also used : PostgresTester(org.folio.util.PostgresTester) Test(org.junit.Test)

Example 4 with PostgresTester

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);
}
Also used : PostgresTester(org.folio.util.PostgresTester) Test(org.junit.Test)

Aggregations

PostgresTester (org.folio.util.PostgresTester)4 Test (org.junit.Test)4 AESTest (org.folio.rest.security.AESTest)1