Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.ComponentInformation


    @Test
    public void validForumInformationShouldProduceSuccessResponse() {
        Component component = setupComponentMock();

        BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(new Object(), "");
        ComponentInformation ci = new ComponentInformation();
        when(favIconIcoControllerUtils.getImageService()).thenReturn(iconImageService);
        JsonResponse response = administrationController.setForumInformation(ci, bindingResult, Locale.UK);

        verify(componentService).setComponentInformation(ci);
        assertEquals(response.getStatus(), JsonResponseStatus.SUCCESS);
View Full Code Here


    @Test
    public void invalidForumInformationShouldProduceFailResponse() {
        BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(new Object(), "");
        bindingResult.addError(new ObjectError("name", "message"));
        JsonResponse response = administrationController.setForumInformation(new ComponentInformation(), bindingResult,
                Locale.UK);

        assertEquals(response.getStatus(), JsonResponseStatus.FAIL);
    }
View Full Code Here

        when(componentDao.getComponent()).thenReturn(component);
        Base64Wrapper wrapper = new Base64Wrapper();
        byte[] iconBytes = wrapper.decodeB64Bytes(ICON);
        when(imageService.preProcessAndEncodeInString64(iconBytes)).thenReturn(ICON_IN_ICO_FORMAT);

        ComponentInformation information = new ComponentInformation();
        information.setId(COMPONENT_ID);
        information.setName(FORUM_NAME);
        information.setDescription(FORUM_DESCRIPTION);
        information.setLogoTooltip(FORUM_LOGO_TOOLTIP);
        information.setLogo(logo);
        information.setIcon(ICON);

        componentService.setComponentInformation(information);

        verify(component).setName(FORUM_NAME);
        verify(component).setDescription(FORUM_DESCRIPTION);
View Full Code Here

    @Test(dataProvider = "emptyValues")
    public void setComponentInformationShouldNotSetIconIfItIsEmpty(String icon) throws ImageProcessException {
        when(componentDao.getComponent()).thenReturn(component);

        ComponentInformation information = new ComponentInformation();
        information.setId(COMPONENT_ID);
        information.setName(FORUM_NAME);
        information.setDescription(FORUM_DESCRIPTION);
        information.setLogoTooltip(FORUM_LOGO_TOOLTIP);
        information.setLogo(LOGO);
        information.setIcon(icon);

        componentService.setComponentInformation(information);

        verify(component).setName(FORUM_NAME);
        verify(component).setDescription(FORUM_DESCRIPTION);
View Full Code Here

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void setComponentInformationShouldThrowExceptionWhenComponentIdIsNotSame() throws ImageProcessException {
        when(componentDao.getComponent()).thenReturn(component);

        ComponentInformation information = new ComponentInformation();
        information.setId(COMPONENT_ID + 1);

        componentService.setComponentInformation(information);
    }
View Full Code Here

        when(componentDao.getComponent()).thenReturn(component);
        Base64Wrapper wrapper = new Base64Wrapper();
        byte[] iconBytes = wrapper.decodeB64Bytes(ICON);
        when(imageService.preProcessAndEncodeInString64(iconBytes)).thenReturn(ICON_IN_ICO_FORMAT);

        ComponentInformation information = new ComponentInformation();
        information.setId(COMPONENT_ID);
        information.setName(FORUM_NAME);
        information.setDescription(FORUM_DESCRIPTION);
        information.setLogoTooltip(FORUM_LOGO_TOOLTIP);
        information.setLogo(LOGO);
        information.setIcon(ICON);

        componentService.setComponentInformation(information);

        verify(component).setName(FORUM_NAME);
        verify(component).setDescription(FORUM_DESCRIPTION);
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.ComponentInformation

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.