@Test
  public void testGetStringNull() throws SQLException {
    FieldSchema fieldSchema = new FieldSchema();
    fieldSchema.setType("varchar(64)");

    List<FieldSchema> fieldSchemas = Arrays.asList(fieldSchema);
    TableSchema schema = new TableSchema(fieldSchemas);

    HiveBaseResultSet resultSet = Mockito.mock(HiveBaseResultSet.class);
    resultSet.row = new Object[] {null};

    when(resultSet.getSchema()).thenReturn(schema);
    when(resultSet.getString(1)).thenCallRealMethod();
    when(resultSet.wasNull()).thenCallRealMethod();

    Assert.assertNull(resultSet.getString(1));
    Assert.assertTrue(resultSet.wasNull());
  }
Test suite for {@link HiveBaseResultSet} class.
jdbc/src/test/org/apache/hive/jdbc/TestHiveBaseResultSet.java