use of com.thoughtworks.go.config.registry.ConfigElementImplementationRegistrar in project gocd by gocd.
the class ConfigElementImplementationRegistryMother method withNoPlugins.
public static ConfigElementImplementationRegistry withNoPlugins() {
ConfigElementImplementationRegistry registry = new ConfigElementImplementationRegistry(new NoPluginsInstalled());
new ConfigElementImplementationRegistrar(registry).initialize();
return registry;
}
use of com.thoughtworks.go.config.registry.ConfigElementImplementationRegistrar in project gocd by gocd.
the class ConfigCipherUpdaterTest method setUp.
@Before
public void setUp() throws Exception {
systemEnvironment.setProperty(SystemEnvironment.CONFIG_DIR_PROPERTY, temporaryFolder.newFolder().getAbsolutePath());
final Date currentTime = new DateTime().toDate();
timestamp = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(currentTime);
updater = new ConfigCipherUpdater(systemEnvironment, new TimeProvider() {
@Override
public Date currentTime() {
return currentTime;
}
});
configCache = new ConfigCache();
registry = new ConfigElementImplementationRegistry(new NoPluginsInstalled());
ConfigElementImplementationRegistrar registrar = new ConfigElementImplementationRegistrar(registry);
registrar.initialize();
magicalGoConfigXmlLoader = new MagicalGoConfigXmlLoader(configCache, registry);
File configFileEncryptedWithFlawedCipher = new ClassPathResource("cruise-config-with-encrypted-with-flawed-cipher.xml").getFile();
FileUtil.writeContentToFile(ConfigCipherUpdater.FLAWED_VALUE, systemEnvironment.getCipherFile());
ReflectionUtil.setStaticField(CipherProvider.class, "cachedKey", null);
String xml = ConfigMigrator.migrate(FileUtil.readContentFromFile(configFileEncryptedWithFlawedCipher));
originalConfigFile = new File(systemEnvironment.getCruiseConfigFile());
FileUtils.writeStringToFile(originalConfigFile, xml);
}
Aggregations