}
@Test
public void startConfiguringPluginShouldMoveToPluginConfigurationPage() throws NotFoundException {
String configuredPluginName = "plugin";
PluginConfiguration expectedConfiguration = new PluginConfiguration();
long componentId = 25L;
Component component = new Component();
component.setId(componentId);
List<Plugin> pluginList = Arrays.asList((Plugin) new DummyPlugin());
when(componentService.getComponentOfForum()).thenReturn(component);
when(pluginService.getPluginConfiguration(configuredPluginName, componentId)).thenReturn(expectedConfiguration);
when(pluginLoader.getPlugins(new NameFilter(configuredPluginName))).thenReturn(pluginList);
ModelAndView pluginConfigModelAndView = pluginController.startConfiguringPlugin(configuredPluginName);
assertViewName(pluginConfigModelAndView, "plugin/pluginConfiguration");
assertModelAttributeAvailable(pluginConfigModelAndView, "pluginConfiguration");
assertModelAttributeAvailable(pluginConfigModelAndView, "labelsTranslation");
PluginConfiguration actualPluginConfiguration = (PluginConfiguration) pluginConfigModelAndView.getModel().get("pluginConfiguration");
assertEquals(actualPluginConfiguration, expectedConfiguration, "Plugin should be returned from services.");
}