private void verifyNoHDFSApiInvocationForDefaultPolicy() throws URISyntaxException, IOException {
    FileSystem testFs = new AlwaysFailSetStoragePolicyFileSystem();
    testFs.initialize(new URI("hdfs://localhost/"), conf);
    // There should be no exception thrown when setting to default storage policy, which indicates
    // the HDFS API hasn't been called
    try {
      CommonFSUtils.setStoragePolicy(testFs, new Path("non-exist"),
        HConstants.DEFAULT_WAL_STORAGE_POLICY, true);
    } catch (IOException e) {
      Assert.fail("Should have bypassed the FS API when setting default storage policy");
    }
    // There should be exception thrown when given non-default storage policy, which indicates the
    // HDFS API has been called
    try {
      CommonFSUtils.setStoragePolicy(testFs, new Path("non-exist"), "HOT", true);
      Assert.fail("Should have invoked the FS API but haven't");
    } catch (IOException e) {
      // expected given an invalid path
    }
  }
Note: currently the default policy is set to defer to HDFS and this case is to verify the
logic, will need to remove the check if the default policy is changed
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java