use of com.thoughtworks.go.presentation.MissingPluggableTaskViewModel in project gocd by gocd.
the class PluggableTaskViewModelFactoryTest method shouldReturnMissingPluginTaskViewIfPluginIsMissing.
@Test
public void shouldReturnMissingPluginTaskViewIfPluginIsMissing() {
String pluginId = "pluginId";
PluggableTaskViewModelFactory factory = new PluggableTaskViewModelFactory();
PluggableViewModel<PluggableTask> viewModel = factory.viewModelFor(new PluggableTask(new PluginConfiguration(pluginId, "1"), new Configuration()), "edit");
assertThat(viewModel.getParameters().get("template"), is(String.format("Associated plugin '%s' not found. Please contact the Go admin to install the plugin.", pluginId)));
assertThat(viewModel.getTypeForDisplay(), is(pluginId));
assertThat(viewModel instanceof MissingPluggableTaskViewModel, is(true));
}
use of com.thoughtworks.go.presentation.MissingPluggableTaskViewModel in project gocd by gocd.
the class MissingPluggableTaskViewModelTest method shouldReturnPluginIdAsDisplayValue.
@Test
public void shouldReturnPluginIdAsDisplayValue() throws Exception {
PluginConfiguration pluginConfiguration = new PluginConfiguration("test-plugin-1", "1.0");
PluggableTask pluggableTask = new PluggableTask(pluginConfiguration, new Configuration());
MissingPluggableTaskViewModel viewModel = new MissingPluggableTaskViewModel(pluggableTask, null);
assertThat(viewModel.getParameters().get("template"), is(String.format("Associated plugin '%s' not found. Please contact the Go admin to install the plugin.", pluginConfiguration.getId())));
assertThat(viewModel.getTypeForDisplay(), is(pluginConfiguration.getId()));
}
Aggregations