@Test
public void execute_insert_createsRecordsCorrectly() throws Exception {

    engine.create(testIndex);
    IndexCommit commit = mock(IndexCommit.class);
    when(commit.getTimestamp()).thenReturn(new Date(42));
    // TODO: mock entire commit
    List models = new ArrayList<>();
    models.add(new TestModel("A", 42));
    models.add(new TestModel("B", -42));
    InsertOperation operation = new InsertOperation(commit, testIndex, models);
    engine.execute(operation);
    try (ResultSet rs = connection.createStatement().executeQuery("SELECT * FROM HISTORY_TABLE")) {
        assertTrue(rs.next());
        assertEquals("A", rs.getString("TESTID"));
        assertEquals(42, rs.getInt("TESTINTEGER"));
        assertEquals(1L, rs.getLong("REV_ID"));
        assertEquals("INSERT", rs.getString("REV_OPERATION"));
        assertEquals(new Date(42), rs.getTimestamp("REV_TIMESTAMP"));
        assertTrue(rs.next());
        assertEquals("B", rs.getString("TESTID"));
        assertEquals(-42, rs.getInt("TESTINTEGER"));
        assertEquals(2L, rs.getLong("REV_ID"));
        assertEquals("INSERT", rs.getString("REV_OPERATION"));
        assertEquals(new Date(42), rs.getTimestamp("REV_TIMESTAMP"));
        assertFalse(rs.next());
    }
}