Package org.jtalks.common.model.entity

Examples of org.jtalks.common.model.entity.Component


            HttpServletResponse response,
            Object handler,
            ModelAndView modelAndView) throws Exception {
        super.postHandle(request, response, handler, modelAndView);
        if (modelAndView != null) {
            Component component = componentService.getComponentOfForum();
            modelAndView.addObject(FORUM_COMPONENT_MODEL_PARAM, component);
        }
    }
View Full Code Here


    @BeforeMethod
    public void init() {
        initMocks(this);

        Component component = new Component("Forum", "Cool Forum", ComponentType.FORUM);
        component.setId(42);

        administrationController = new AdministrationImagesController(componentService, logoControllerUtils,
                favIconPngControllerUtils, favIconIcoControllerUtils,
                messageSource);
    }
View Full Code Here

        checkResponse(response);
    }

    @Test
    public void getForumLogoShouldReturnDefaultLogoWhenLogoPropertyIsEmpty() throws ImageProcessException {
        Component forumComponent = new Component();
        forumComponent.addProperty(TransactionalComponentService.LOGO_PROPERTY, "");
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(logoControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

        assertEquals(response.getContentAsByteArray(), validImage);
    }

    @Test
    public void getForumLogoShouldReturnDefaultLogoWhenLogoPropertyIsNull() throws ImageProcessException {
        Component forumComponent = new Component();
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(logoControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

        assertEquals(response.getContentAsByteArray(), validImage);
    }

    @Test
    public void getForumLogoShouldReturnPropertyLogoWhenPropertyExists() throws IOException, ImageProcessException {
        Component forumComponent = new Component();

        String logoProperty = "logo";
        Base64Wrapper wrapper = new Base64Wrapper();
        byte[] logoBytes = wrapper.decodeB64Bytes(logoProperty);

        forumComponent.addProperty(TransactionalComponentService.LOGO_PROPERTY, logoProperty);
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());

        MockHttpServletResponse response = new MockHttpServletResponse();
        administrationController.getForumLogo(new MockHttpServletRequest(), response);
View Full Code Here

    }


    @Test
    public void getFavIconPNGShouldReturnDefaultIconWhenIconPropertyIsEmpty() throws ImageProcessException {
        Component forumComponent = new Component();
        forumComponent.addProperty(TransactionalComponentService.COMPONENT_FAVICON_PNG_PARAM, "");
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(favIconPngControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

        assertEquals(response.getContentAsByteArray(), validImage);
    }

    @Test
    public void getFavIconPNGShouldReturnDefaultIconWhenIconPropertyIsNull() throws ImageProcessException {
        Component forumComponent = new Component();
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(favIconPngControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

        assertEquals(response.getContentAsByteArray(), validImage);
    }

    @Test
    public void getFavIconPNGLogoShouldReturnPropertyIconWhenPropertyExists() throws IOException, ImageProcessException {
        Component forumComponent = new Component();

        String logoProperty = "logo";
        Base64Wrapper wrapper = new Base64Wrapper();
        byte[] logoBytes = wrapper.decodeB64Bytes(logoProperty);

        forumComponent.addProperty(TransactionalComponentService.COMPONENT_FAVICON_PNG_PARAM, logoProperty);
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());

        MockHttpServletResponse response = new MockHttpServletResponse();
        administrationController.getFavIconPNG(new MockHttpServletRequest(), response);
View Full Code Here

    }


    @Test
    public void getFavIconICOShouldReturnDefaultIconWhenIconPropertyIsEmpty() throws ImageProcessException {
        Component forumComponent = new Component();
        forumComponent.addProperty(TransactionalComponentService.COMPONENT_FAVICON_PNG_PARAM, "");
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(favIconIcoControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

        assertEquals(response.getContentAsByteArray(), validImage);
    }

    @Test
    public void getFavIconICOShouldReturnDefaultIconWhenIconPropertyIsNull() throws ImageProcessException {
        Component forumComponent = new Component();
        when(componentService.getComponentOfForum()).thenReturn(forumComponent);
        when(componentService.getComponentModificationTime()).thenReturn(new Date());
        when(favIconIcoControllerUtils.getDefaultImage()).thenReturn(validImage);

        MockHttpServletResponse response = new MockHttpServletResponse();
View Full Code Here

TOP

Related Classes of org.jtalks.common.model.entity.Component

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.