@Override
  public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) {
    Preconditions.checkNotNull(path, "Unable to create UnderFileSystem instance:"
        + " URI path should not be null");

    if (checkCOSCredentials(conf)) {
      try {
        return COSUnderFileSystem.createInstance(new AlluxioURI(path), conf);
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }

    String err = "COS Credentials not available, cannot create COS Under File System.";
    throw Throwables.propagate(new IOException(err));
  }
@Test
  public void createInstanceWithoutCredentials() {
    Configuration.unset(PropertyKey.COS_ACCESS_KEY);
    Configuration.unset(PropertyKey.COS_SECRET_KEY);
    Configuration.unset(PropertyKey.COS_REGION);
    Configuration.unset(PropertyKey.COS_APP_ID);
    mAlluxioConf = Configuration.global();
    mConf = UnderFileSystemConfiguration.defaults(mAlluxioConf);

    try {
      mFactory.create(mCosPath, mConf);
    } catch (Exception e) {
      Assert.assertTrue(e instanceof RuntimeException);
      Assert.assertTrue(e.getMessage().contains("COS Credentials not available, "
          + "cannot create COS Under File System."));
    }
    Exception e = Assert.assertThrows(RuntimeException.class, () -> mFactory.create(
        mCosPath, mConf));
    Assert.assertTrue(e.getMessage().contains("COS Credentials not available, "
        + "cannot create COS Under File System."));
  }