/**
* Simple test demonstrating use of {@code @Rule}.
*/
public class ContainerExampleTest {
@Rule
public final FirebirdContainer container = new FirebirdContainer();
@Test
public void canConnectToContainer() throws Exception {
try (Connection connection = DriverManager
.getConnection(container.getJdbcUrl(), container.getUsername(),
container.getPassword());
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("select CURRENT_USER from RDB$DATABASE")) {
assertTrue("has row", rs.next());
assertEquals("user name",
container.getUsername().toUpperCase(), rs.getString(1));
}
}
}