WorkflowOutputDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (workflowOutput != null) { config.setWorkflowOutput(workflowOutput); } } WorkflowOutputDelegate(); String getWorkflowOutput(); void setWorkflowOutput(String workflowOutput); @Override void applyDelegate(Config config);  }
@Test public void testApplyDelegate() { Config config = Config.createConfig(); args = new String[2]; args[0] = "-workflow_output"; args[1] = "path"; jcommander.parse(args); assertFalse("path".equals(config.getWorkflowOutput())); delegate.applyDelegate(config); assertTrue("path".equals(config.getWorkflowOutput())); }
@Test public void testNothingSetNothingChanges() { Config config = Config.createConfig(); Config config2 = Config.createConfig(); delegate.applyDelegate(config); assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate")); }