@Override
    public void validate(CruiseConfig cruiseConfig) {
        ServerConfig serverConfig = cruiseConfig.server();
        String artifactDir = serverConfig.artifactsDir();

        if (isEmpty(artifactDir)) {
            throw new RuntimeException("Please provide a not empty value for artifactsdir");
        }

        if (StringUtils.equals(".", artifactDir) || new File("").getAbsolutePath().equals(
                new File(artifactDir).getAbsolutePath())) {
            throw new RuntimeException("artifactsdir should not point to the root of sand box [" +
                    new File(artifactDir).getAbsolutePath()
                    + "]");
        }
    }
@Test
    public void shouldThrowExceptionWhenUserProvidesEmtpty() {
        CruiseConfig cruiseConfig = new BasicCruiseConfig();
        cruiseConfig.setServerConfig(new ServerConfig("", null));

        ArtifactDirValidator dirValidator = new ArtifactDirValidator();
        try {
            dirValidator.validate(cruiseConfig);
            fail("should throw exception");
        } catch (Exception e) {
        }
    }