@Test
public void testCreateWithoutWritePermissions() throws Exception {

  BaseUser user = server.addUser("test", "password");
  Configuration configuration = new Configuration();
  configuration.set("fs.defaultFS", "ftp:///");
  configuration.set("fs.ftp.host", "localhost");
  configuration.setInt("fs.ftp.host.port", server.getPort());
  configuration.set("fs.ftp.user.localhost", user.getName());
  configuration.set("fs.ftp.password.localhost", user.getPassword());
  configuration.setBoolean("fs.ftp.impl.disable.cache", true);
  FileSystem fs = FileSystem.get(configuration);
  byte[] bytesExpected = "hello world".getBytes(StandardCharsets.UTF_8);
  LambdaTestUtils.intercept(
      IOException.class, "Unable to create file: test1.txt, Aborting",
      () -> {
        try (FSDataOutputStream out = fs.create(new Path("test1.txt"))) {
          out.write(bytesExpected);
        }
      }
  );
}