@Test
public void testExecute() throws SQLException {

  HiveConnection hiveConnection = createNiceMock(HiveConnection.class);
  HiveStatement hiveStatement = createNiceMock(HiveStatement.class);
  HiveQueryResultSet resultSet = createNiceMock(HiveQueryResultSet.class);
  expect(hiveConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)).andReturn(hiveStatement);
  String query = "select * from test";
  expect(hiveStatement.execute(query)).andReturn(true);
  expect(hiveStatement.getResultSet()).andReturn(resultSet);
  replay(hiveConnection, hiveStatement, resultSet);
  HiveJdbcConnectionDelegate hiveJdbcConnectionDelegate = new HiveJdbcConnectionDelegate();
  Optional<ResultSet> execute = hiveJdbcConnectionDelegate.execute(hiveConnection, query);
  assertEquals(execute.get(), resultSet);
  verify(hiveConnection, hiveStatement, resultSet);
}