### Question:
PluginController { @RequestMapping(value = "/configure/{name}", method = RequestMethod.GET) public ModelAndView startConfiguringPlugin(@PathVariable String name) throws NotFoundException { long componentId = getForumComponentId(); PluginConfiguration pluginConfiguration = pluginService.getPluginConfiguration(name, componentId); return getModel(pluginConfiguration); } @Autowired  PluginController(PluginService pluginService, ComponentService componentService, PluginLoader pluginLoader,
                            UserService userService); @RequestMapping(value = "/list", method = RequestMethod.GET) ModelAndView getPlugins(); @RequestMapping(value = "/configure/{name}", method = RequestMethod.GET) ModelAndView startConfiguringPlugin(@PathVariable String name); @RequestMapping(value = "/configure/{name}", method = RequestMethod.POST) ModelAndView updateConfiguration(Model model, @ModelAttribute PluginConfiguration newConfiguration); @RequestMapping(value = "/activate", method = RequestMethod.POST) @ResponseBody JsonResponse activatePlugin(@RequestBody PluginActivatingDto pluginActivatingDto);  }### Answer:
@Test(expectedExceptions = NotFoundException.class) public void startConfiguringPluginWhenPluginWasNotFoundShouldShowNotFoundError() throws NotFoundException { long componentId = 25L; Component component = new Component(); component.setId(componentId); when(componentService.getComponentOfForum()).thenReturn(component); String nonExistPluginName = "non-exist"; when(pluginService.getPluginConfiguration(nonExistPluginName, componentId)).thenThrow(new NotFoundException()); pluginController.startConfiguringPlugin(nonExistPluginName); }