use of com.thoughtworks.go.service.ConfigRepository in project gocd by gocd.
the class ConfigRepositoryValidatorServiceTest method shouldNotShutDownServerIfConfigRepositoryIsSane.
@Test
public void shouldNotShutDownServerIfConfigRepositoryIsSane() throws Exception {
ConfigRepository configRepository = mock(ConfigRepository.class);
when(configRepository.isRepositoryCorrupted()).thenReturn(false);
ConfigRepositoryValidatorService configRepositoryValidatorServiceSpy = spy(new ConfigRepositoryValidatorService(configRepository));
doNothing().when(configRepositoryValidatorServiceSpy).shutDownServer();
configRepositoryValidatorServiceSpy.afterPropertiesSet();
verify(configRepositoryValidatorServiceSpy, never()).shutDownServer();
}
use of com.thoughtworks.go.service.ConfigRepository in project gocd by gocd.
the class GoConfigMigratorIntegrationTest method setUp.
@BeforeEach
public void setUp(@TempDir File temporaryFolder, ResetCipher resetCipher) throws Exception {
dbHelper.onSetUp();
configFile = new File(temporaryFolder, "cruise-config.xml");
new SystemEnvironment().setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, configFile.getAbsolutePath());
GoConfigFileHelper.clearConfigVersions();
configRepository = new ConfigRepository(systemEnvironment);
configRepository.initialize();
serverHealthService.removeAllLogs();
resetCipher.setupDESCipherFile();
resetCipher.setupAESCipherFile();
exceptions = new ArrayList<>();
MagicalGoConfigXmlLoader xmlLoader = new MagicalGoConfigXmlLoader(configCache, registry);
goConfigMigrator = new GoConfigMigrator(goConfigMigration, systemEnvironment, fullConfigSaveNormalFlow, xmlLoader, new GoConfigFileReader(systemEnvironment), configRepository, serverHealthService, new GoConfigMigrator.UpgradeFailedHandler() {
@Override
public void handle(Exception e) {
exceptions.add(e);
}
});
}
use of com.thoughtworks.go.service.ConfigRepository in project gocd by gocd.
the class GoConfigMigrationIntegrationTest method setUp.
@BeforeEach
public void setUp(@TempDir File temporaryFolder, ResetCipher resetCipher) throws Exception {
configFile = new File(temporaryFolder, "cruise-config.xml");
new SystemEnvironment().setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, configFile.getAbsolutePath());
GoConfigFileHelper.clearConfigVersions();
configRepository = new ConfigRepository(systemEnvironment);
configRepository.initialize();
serverHealthService.removeAllLogs();
loader = new MagicalGoConfigXmlLoader(new ConfigCache(), ConfigElementImplementationRegistryMother.withNoPlugins());
resetCipher.setupDESCipherFile();
resetCipher.setupAESCipherFile();
}
use of com.thoughtworks.go.service.ConfigRepository in project gocd by gocd.
the class InvalidConfigMessageRemoverIntegrationTest method setUp.
@BeforeEach
public void setUp(@TempDir File tempFolder) throws Exception {
configFile = new File(tempFolder, "cruise-config.xml");
configFile.createNewFile();
GoConfigFileHelper.clearConfigVersions();
configHelper = new GoConfigFileHelper();
configHelper.onSetUp();
SystemEnvironment systemEnvironment = new SystemEnvironment();
systemEnvironment.setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, configFile.getAbsolutePath());
new ConfigRepository(systemEnvironment).initialize();
serverHealthService.removeAllLogs();
}
Aggregations