WorkflowTypeDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (workflowTraceType != null) { config.setWorkflowTraceType(workflowTraceType); } } WorkflowTypeDelegate(); WorkflowTraceType getWorkflowTraceType(); void setWorkflowTraceType(WorkflowTraceType workflowTraceType); @Override void applyDelegate(Config config);  }
@Test public void testApplyDelegate() { Config config = Config.createConfig(); args = new String[2]; args[0] = "-workflow_trace_type"; args[1] = "FULL"; jcommander.parse(args); assertFalse(WorkflowTraceType.FULL.equals(config.getWorkflowTraceType())); delegate.applyDelegate(config); assertTrue(WorkflowTraceType.FULL.equals(config.getWorkflowTraceType())); }
@Test public void testNothingSetNothingChanges() { Config config = Config.createConfig(); Config config2 = Config.createConfig(); delegate.applyDelegate(config); assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate")); }