@Test
public void testSetup() {

    Map<String, String> config = workingFtpConfig();
    
    try {
        retriever.setupDataRetrieval(config, source);
    } catch (Exception e) {
        fail("Should not fail with full config. exception message was : " + e.getMessage());
    }
    
    config = workingFtpConfig();
    config.remove("username");
    try {
        retriever.setupDataRetrieval(config, source);
        fail("Should fail when missing username");
    } catch (Exception e) {
        assertTrue("Failure should be caused by a missing username. Error actually was: " + e.getMessage()
                , e.getMessage().startsWith(FtpRetriever.class.getCanonicalName() + ".noUsername"));
    }
    
    config = workingFtpConfig();
    config.remove("password");
    try {
        retriever.setupDataRetrieval(config, source);
        fail("Should fail when missing password");
    } catch (Exception e) {
        assertTrue("Failure should be caused by a missing password. Error actually was: " + e.getMessage()
                , e.getMessage().startsWith(FtpRetriever.class.getCanonicalName() + ".noPassword"));
    }
    
    config = workingFtpConfig();
    config.remove("server");
    try {
        retriever.setupDataRetrieval(config, source);
        fail("Should fail when missing server");
    } catch (Exception e) {
        assertTrue("Failure should be caused by a missing server URL. Error actually was: " + e.getMessage()
            , e.getMessage().startsWith(FtpRetriever.class.getCanonicalName() + ".noServerSpecified"));
    }
    
    config = workingFtpConfig();
    config.remove("conType");
    try {
        retriever.setupDataRetrieval(config, source);
    } catch (Exception e) {
        fail("Should use default FTP when missing conType");
    }
}