Search in sources :

Example 26 with ConfigElementImplementationRegistry

use of com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry in project gocd by gocd.

the class FullConfigSaveNormalFlowTest method setup.

@BeforeEach
public void setup() throws Exception {
    configForEdit = new BasicCruiseConfig();
    updateConfigCommand = new FullConfigUpdateCommand(configForEdit, "md5");
    loader = mock(MagicalGoConfigXmlLoader.class);
    writer = mock(MagicalGoConfigXmlWriter.class);
    document = mock(Document.class);
    fileWriter = mock(GoConfigFileWriter.class);
    timeProvider = mock(TimeProvider.class);
    configRepository = mock(ConfigRepository.class);
    cachedGoPartials = mock(CachedGoPartials.class);
    configElementImplementationRegistry = mock(ConfigElementImplementationRegistry.class);
    partials = new ArrayList<>();
    flow = new FullConfigSaveNormalFlow(loader, writer, configElementImplementationRegistry, timeProvider, configRepository, cachedGoPartials, fileWriter);
    when(writer.documentFrom(configForEdit)).thenReturn(document);
    when(loader.preprocessAndValidate(configForEdit)).thenReturn(new BasicCruiseConfig());
    when(writer.toString(document)).thenReturn("cruise_config");
}
Also used : FullConfigUpdateCommand(com.thoughtworks.go.config.update.FullConfigUpdateCommand) TimeProvider(com.thoughtworks.go.util.TimeProvider) ConfigElementImplementationRegistry(com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry) ConfigRepository(com.thoughtworks.go.service.ConfigRepository) Document(org.jdom2.Document) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ConfigElementImplementationRegistry (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry)26 Test (org.junit.jupiter.api.Test)10 ExecTask (com.thoughtworks.go.config.ExecTask)8 NoPluginsInstalled (com.thoughtworks.go.config.registry.NoPluginsInstalled)6 ConfigRepository (com.thoughtworks.go.service.ConfigRepository)6 TimeProvider (com.thoughtworks.go.util.TimeProvider)6 ConfigElementImplementationRegistrar (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistrar)5 IOException (java.io.IOException)5 BeforeEach (org.junit.jupiter.api.BeforeEach)5 AntTask (com.thoughtworks.go.config.AntTask)3 PluggableTask (com.thoughtworks.go.config.pluggabletask.PluggableTask)3 FullConfigUpdateCommand (com.thoughtworks.go.config.update.FullConfigUpdateCommand)3 PluginManager (com.thoughtworks.go.plugin.infra.PluginManager)3 Date (java.util.Date)3 Before (org.junit.Before)3 Test (org.junit.Test)3 ConfigCache (com.thoughtworks.go.config.ConfigCache)2 FetchTask (com.thoughtworks.go.config.FetchTask)2 MagicalGoConfigXmlLoader (com.thoughtworks.go.config.MagicalGoConfigXmlLoader)2 ServerHealthService (com.thoughtworks.go.serverhealth.ServerHealthService)2