Search in sources :

Example 1 with TaskExtension

use of com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension in project gocd by gocd.

the class PluggableTaskServiceTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    taskExtension = mock(TaskExtension.class);
    pluggableTaskService = new PluggableTaskService(taskExtension);
    final TaskPreference preference = mock(TaskPreference.class);
    final TaskConfig taskConfig = new TaskConfig();
    final TaskConfigProperty key1 = taskConfig.addProperty("KEY1");
    key1.with(Property.REQUIRED, true);
    taskConfig.addProperty("KEY2");
    when(preference.getConfig()).thenReturn(taskConfig);
    PluggableTaskConfigStore.store().setPreferenceFor(pluginId, preference);
}
Also used : TaskExtension(com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension) TaskConfig(com.thoughtworks.go.plugin.api.task.TaskConfig) TaskConfigProperty(com.thoughtworks.go.plugin.api.task.TaskConfigProperty) TaskPreference(com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with TaskExtension

use of com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension in project gocd by gocd.

the class PluggableTaskBuilderTest method setUp.

@BeforeEach
public void setUp() {
    PluginManagerReference.reference().setPluginManager(pluginManager);
    when(pluggableTask.getPluginConfiguration()).thenReturn(new PluginConfiguration(TEST_PLUGIN_ID, "1.0"));
    HashMap<String, Map<String, String>> pluginConfig = new HashMap<>();
    when(pluggableTask.configAsMap()).thenReturn(pluginConfig);
    taskExtension = new TaskExtension(pluginManager, extensionsRegistry);
}
Also used : TaskExtension(com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension) HashMap(java.util.HashMap) PluginConfiguration(com.thoughtworks.go.domain.config.PluginConfiguration) HashMap(java.util.HashMap) Map(java.util.Map) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TaskExtension (com.thoughtworks.go.plugin.access.pluggabletask.TaskExtension)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 PluginConfiguration (com.thoughtworks.go.domain.config.PluginConfiguration)1 TaskPreference (com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)1 TaskConfig (com.thoughtworks.go.plugin.api.task.TaskConfig)1 TaskConfigProperty (com.thoughtworks.go.plugin.api.task.TaskConfigProperty)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1