WorkflowInputDelegate extends Delegate { @Override public void applyDelegate(Config config) { FileInputStream fis = null; if (workflowInput != null) { config.setWorkflowInput(workflowInput); } } WorkflowInputDelegate(); String getWorkflowInput(); void setWorkflowInput(String workflowInput); @Override void applyDelegate(Config config);  }
@Test public void testApplyDelegate() { Config config = Config.createConfig(); config.setWorkflowInput(null); args = new String[2]; args[0] = "-workflow_input"; args[1] = tempFile.getAbsolutePath(); jcommander.parse(args); assertFalse(config.getWorkflowInput() != null); delegate.applyDelegate(config); assertTrue(config.getWorkflowInput() != null); }
@Test public void testNothingSetNothingChanges() { Config config = Config.createConfig(); Config config2 = Config.createConfig(); delegate.applyDelegate(config); assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate")); }