Package org.jtalks.jcommune.plugin.api.exceptions

Examples of org.jtalks.jcommune.plugin.api.exceptions.UnexpectedErrorException


    public void registerUserShouldFailIfPluginThrowsUnexpectedErrorException() throws Exception {
        RegisterUserDto userDto = createRegisterUserDto("username", "password", "email@email.em", null);
        RegistrationPlugin plugin = mock(RegistrationPlugin.class);
        when(plugin.getState()).thenReturn(Plugin.State.ENABLED);
        when(plugin.registerUser(userDto.getUserDto(), 1L))
                .thenThrow(new UnexpectedErrorException());
        when(pluginService.getRegistrationPlugins()).thenReturn(
                new ImmutableMap.Builder<Long, RegistrationPlugin>().put(1L, plugin).build());

        authenticator.register(userDto);
    }
View Full Code Here


        }
        willBeConfigured.configure(pluginConfiguration);
        try {
            saveNewPluginConfiguration(pluginConfiguration);
        } catch (RuntimeException ex) {
            throw new UnexpectedErrorException(ex);
        }
    }
View Full Code Here

                && clientResource.getResponseEntity() != null) {
            return Collections.emptyMap();
        } else if (clientResource.getStatus().getCode() == Status.CLIENT_ERROR_BAD_REQUEST.getCode()) {
            return parseErrors(clientResource.getResponseEntity(), locale);
        } else if (clientResource.getStatus().getCode() == Status.SERVER_ERROR_INTERNAL.getCode()) {
            throw new UnexpectedErrorException();
        } else {
            throw new NoConnectionException(clientResource.getStatus().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.plugin.api.exceptions.UnexpectedErrorException

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.