@Test
  public void testSpecialCharsInPath() throws Exception {
    String filePath = TEST_JAR_DIR + "testjar-[specialchars].jar";
    String filePathEncoded = TEST_JAR_DIR + "testjar-%5Bspecialchars%5D.jar";
    writeTestJarFile(filePath, "sample");

    SessionState ss = Mockito.spy(SessionState.start(conf).get());
    try {
      ss.add_resource(t, filePath);
    } catch (RuntimeException e) {
      assertEquals(URISyntaxException.class, e.getCause().getClass());
    }
    ss.add_resource(t, filePathEncoded);

    Set<String> result = ss.list_resource(t, null);
    assertEquals(1, result.size());
    assertEquals(filePath, result.stream().findFirst().get());

    ss.close();
  }
Tests adding jar with special chars in the path:
- works if it's given in URL encoded format
- fails if it's not encoded (user should have done it).
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/session/TestAddResource.java