@Test(expected = ValidationException.class) public void validationFail() throws ValidationException { Command command = new Import(); HashMap<String, Object> args = new HashMap<String, Object>(); args.put("d", "invalidDir"); command.validate(args); }
@Override public void validate(HashMap<String, Object> args) throws ValidationException { String dir = (String) args.get(DIRECTORY_OPTION); if (!Files.isDirectory(Paths.get(dir))) { throw new ValidationException("directory " + dir + "does not exist"); } }
Import implements Command { @Override public void validate(HashMap<String, Object> args) throws ValidationException { String dir = (String) args.get(DIRECTORY_OPTION); if (!Files.isDirectory(Paths.get(dir))) { throw new ValidationException("directory " + dir + "does not exist"); } } }
Import implements Command { @Override public void validate(HashMap<String, Object> args) throws ValidationException { String dir = (String) args.get(DIRECTORY_OPTION); if (!Files.isDirectory(Paths.get(dir))) { throw new ValidationException("directory " + dir + "does not exist"); } }  }
Import implements Command { @Override public void validate(HashMap<String, Object> args) throws ValidationException { String dir = (String) args.get(DIRECTORY_OPTION); if (!Files.isDirectory(Paths.get(dir))) { throw new ValidationException("directory " + dir + "does not exist"); } }  @Override String getCommandName(); @Override void run(HashMap<String, Object> args); @Override Options getOptions(); @Override void validate(HashMap<String, Object> args); }
Import implements Command { @Override public void validate(HashMap<String, Object> args) throws ValidationException { String dir = (String) args.get(DIRECTORY_OPTION); if (!Files.isDirectory(Paths.get(dir))) { throw new ValidationException("directory " + dir + "does not exist"); } }  @Override String getCommandName(); @Override void run(HashMap<String, Object> args); @Override Options getOptions(); @Override void validate(HashMap<String, Object> args);  }