@Test
public void testInvalidConfig() {

    Map config = new LinkedHashMap<>();
    YoloProcessor ypImageSaver = new YoloProcessor();
    // Nothing included
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
        fail("Should fail without anything in config.");
    } catch (Exception e) {
        assertTrue("Failure should be caused by empty config. Error actually was: " + e.getMessage(),
                e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".missingConfig:"));
    }
    // No meta file or label file
    config.put("pbFile", PB_FILE);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
        fail("Should fail without either a label file or a meta file.");
    } catch (Exception e) {
        assertTrue("Failure should be caused by lack of either label or meta file. Error actually was: "
                + e.getMessage(), e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".missingConfig:"));
    }
    // No pb file included but label file included
    config.remove("pbFile");
    config.put("labelFile", LABEL_FILE);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
        fail("Should fail when label file is included but pbFile is not.");
    } catch (Exception e) {
        assertTrue("Failure should be caused by lack of pbFile even when label file is included. Error actually was: "
                + e.getMessage(), e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".missingConfig:"));
    }
    // No pb file included but label file included
    config.remove("labelFile");
    config.put("metaFile", META_FILE);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
        fail("Should fail when meta file is included but pbFile is not.");
    } catch (Exception e) {
        assertTrue("Failure should be caused by lack of pbFile even when meta file is included. Error actually was: "
                + e.getMessage(), e.getMessage().startsWith(YoloProcessor.class.getCanonicalName() + ".missingConfig:"));
    }
}