Package org.jtalks.common.service.exceptions

Examples of org.jtalks.common.service.exceptions.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);
    }
View Full Code Here


        Query query = session().getNamedQuery("getPluginConfiguration");

        PluginConfiguration configuration = (PluginConfiguration) query.setParameter("name", name).uniqueResult();

        if (configuration == null){
            throw new NotFoundException(name + " plugin not found in the database");
        } else {
            return configuration;
        }
    }
View Full Code Here

    @Test(expectedExceptions = NotFoundException.class)
    public void getPluginConfigurationShouldShowErrorWhenPluginDoesNotExist() throws NotFoundException {
        //GIVEN
        String pluginName = "plugin";
        when(pluginConfigurationDao.get(pluginName)).thenThrow(new NotFoundException());
        //WHEN
        pluginService.getPluginConfiguration(pluginName, FAKE_COMPONENT_ID);
    }
View Full Code Here

        pluginConfiguration.setId(pluginId);
        List<Plugin> pluginList = new ArrayList<>();
        pluginList.add(plugin);
        when(plugin.getState()).thenReturn(Plugin.State.ENABLED);
        when(pluginLoader.getPlugins(any(TypeFilter.class))).thenReturn(pluginList);
        when(pluginConfigurationDao.get(plugin.getName())).thenThrow(new NotFoundException());

        Map<Long, RegistrationPlugin> result = pluginService.getRegistrationPlugins();

        assertEquals(result.size(), 0);
    }
View Full Code Here

                                    long forumComponentId) throws NotFoundException, UnexpectedErrorException {
        String name = pluginConfiguration.getName();
        List<Plugin> pluginsList = pLuginLoader.getPlugins();
        Plugin willBeConfigured = findPluginByName(pluginsList, name);
        if (willBeConfigured == null) {
            throw new NotFoundException("Plugin " + name + " is not loaded");
        }
        willBeConfigured.configure(pluginConfiguration);
        try {
            saveNewPluginConfiguration(pluginConfiguration);
        } catch (RuntimeException ex) {
View Full Code Here

    @Override
    public Plugin getPluginById(String pluginId, PluginFilter... filters) throws NotFoundException {
        PluginConfiguration conf = getDao().get(Long.valueOf(pluginId));
        Plugin plugin = findPluginByName(pLuginLoader.getPlugins(filters), conf.getName());
        if (plugin == null) {
            throw new NotFoundException("Plugin with Id '" + pluginId + "' not found.");
        }
        return plugin;
    }
View Full Code Here

TOP

Related Classes of org.jtalks.common.service.exceptions.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.