GeneralDelegate extends Delegate { @Override public void applyDelegate(Config config) { Security.addProvider(new BouncyCastleProvider()); if (isDebug()) { Configurator.setAllLevels("de.rub.nds.tlsattacker", Level.DEBUG); } else if (quiet) { Configurator.setAllLevels("de.rub.nds.tlsattacker", Level.OFF); } LOGGER.debug("Using the following security providers"); for (Provider p : Security.getProviders()) { LOGGER.debug("Provider {}, version, {}", p.getName(), p.getVersion()); } if (keylogfile != null) { config.setKeylogFilePath(keylogfile); config.setWriteKeylogFile(true); } UnlimitedStrengthEnabler.enable(); } GeneralDelegate(); boolean isHelp(); void setHelp(boolean help); boolean isDebug(); void setDebug(boolean debug); boolean isQuiet(); void setQuiet(boolean quiet); String getKeylogfile(); void setKeylogfile(String keylogfile); @Override void applyDelegate(Config config);  }
@Test public void testApplyDelegate() { Config config = Config.createConfig(); delegate.setKeylogfile("abc"); delegate.applyDelegate(config); assertTrue(config.isWriteKeylogFile()); assertEquals("abc", config.getKeylogFilePath()); }
@Test public void testNothingSetNothingChanges() { Config config = Config.createConfig(); Config config2 = Config.createConfig(); delegate.applyDelegate(config); assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate")); }