### Question:
TransactionalPluginService extends AbstractTransactionalEntityService<PluginConfiguration,
        PluginConfigurationDao> implements PluginService { @Override @PreAuthorize("hasPermission(#forumComponentId, 'COMPONENT', 'GeneralPermission.ADMIN')") public PluginConfiguration getPluginConfiguration(String pluginName, long forumComponentId) throws NotFoundException { return getDao().get(pluginName); } TransactionalPluginService(PluginConfigurationDao dao, PluginLoader pluginLoader); @Override @PreAuthorize("hasPermission(#forumComponentId, 'COMPONENT', 'GeneralPermission.ADMIN')") List<Plugin> getPlugins(long forumComponentId); @Override @PreAuthorize("hasPermission(#forumComponentId, 'COMPONENT', 'GeneralPermission.ADMIN')") void updateConfiguration(PluginConfiguration pluginConfiguration,
                                    long forumComponentId); @Override Map<Long, RegistrationPlugin> getRegistrationPlugins(); @Override Plugin getPluginById(String pluginId, PluginFilter... filters); @Override @PreAuthorize("hasPermission(#forumComponentId, 'COMPONENT', 'GeneralPermission.ADMIN')") PluginConfiguration getPluginConfiguration(String pluginName,
                                                      long forumComponentId); @Override @PreAuthorize("hasPermission(#forumComponentId, 'COMPONENT', 'GeneralPermission.ADMIN')") void updatePluginActivating(PluginActivatingDto updatedPlugin, long forumComponentId);  }### Answer:
@Test public void getPluginConfigurationShouldFindItInDatabase() throws NotFoundException { PluginConfiguration expectedConfiguration = new PluginConfiguration(); String pluginName = "plugin"; when(pluginConfigurationDao.get(pluginName)).thenReturn(expectedConfiguration); PluginConfiguration actualConfiguration = pluginService.getPluginConfiguration(pluginName, FAKE_COMPONENT_ID); assertEquals(actualConfiguration, expectedConfiguration, "Plugin configuration should be retrieved from database."); }
@Test(expectedExceptions = NotFoundException.class) public void getPluginConfigurationShouldShowErrorWhenPluginDoesNotExist() throws NotFoundException { String pluginName = "plugin"; when(pluginConfigurationDao.get(pluginName)).thenThrow(new NotFoundException()); pluginService.getPluginConfiguration(pluginName, FAKE_COMPONENT_ID); }