@Test
  public void testHs2ThriftMaxMessageSize() throws Exception {
    HiveConf.setVar(miniHS2.getHiveConf(), HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE, "512");
    assertEquals(512L,
        HiveConf.getSizeVar(miniHS2.getHiveConf(), HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE));
    Connection conn = DriverManager.getConnection(miniHS2.getJdbcURL());
    Statement stmt = conn.createStatement();
    try {
      StringBuilder createTable = new StringBuilder("create external table tesths2thriftmaxmessagesize(");
      for (int i = 0; i < 100; i++) {
        createTable.append("abcdefghijklmnopqrstuvwxyz").append(i).append(" string, ");
      }
      createTable.append(" a int)");
      Throwable t = assertThrows(SQLException.class, () -> stmt.execute(createTable.toString())).getCause();
      assertTrue(t instanceof TTransportException);
      assertEquals(TTransportException.END_OF_FILE, ((TTransportException)t).getType());
      assertTrue(t.getMessage().contains("Socket is closed by peer"));
    } finally {
      miniHS2.getHiveConf().unset(ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE.varname);
    }
  }
Test connection using the proxy user connection property.
Verify proxy connection fails when super user doesn't have privilege to
impersonate the given user
@throws Exception
itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithMiniKdc.java