Package org.springframework.ui

Examples of org.springframework.ui.ExtendedModelMap.containsAttribute()


        String adminUserDetailView = controller.viewUserDetail(userid, model);
        verify(userService);
       
        assertEquals(ViewNames.ADMIN_USERDETAIL, adminUserDetailView);
        assertTrue(model.containsAttribute(TABS));
        assertEquals(user, model.asMap().get("user"));
    }


    @Test
View Full Code Here


    @Test
    public void setupForm() {
        ModelMap modelMap = new ExtendedModelMap();
        final String viewName = controller.setUpForm(modelMap);
        assertEquals(ViewNames.ADMIN_NEW_ACCOUNT, viewName);
        assertTrue(modelMap.containsAttribute(TABS));
        assertTrue(modelMap.get(ModelKeys.NEW_USER) instanceof NewUser);
    }

    @Test
    public void create_ValidFormSubmitted() throws Exception {
View Full Code Here

        String adminWidgetsView = controller.viewWidgets(DEFAULT_OFFSET, null, model);
        verify(service);
        assertEquals(ViewNames.ADMIN_WIDGETS, adminWidgetsView);
        assertEquals(widgetSearchResult, model.asMap().get(ModelKeys.SEARCHRESULT));
        assertTrue(model.containsAttribute(TABS));
    }

    @Test
    public void searchWidgets() throws Exception {
        Model model = new ExtendedModelMap();
View Full Code Here

        replay(service, categoryService);
        String adminWidgetDetailView = controller.viewWidgetDetail(entityId, model);
        verify(service, categoryService);

        assertEquals(ViewNames.ADMIN_WIDGETDETAIL, adminWidgetDetailView);
        assertTrue(model.containsAttribute(TABS));
        assertEquals(widget, model.asMap().get("widget"));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat((List<Category>) model.asMap().get(ModelKeys.CATEGORIES), is(categories));
    }
View Full Code Here

        verify(service, categoryService);

        assertEquals(ViewNames.ADMIN_WIDGETDETAIL, adminWidgetDetailView);
        assertTrue(model.containsAttribute(TABS));
        assertEquals(widget, model.asMap().get("widget"));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat((List<Category>) model.asMap().get(ModelKeys.CATEGORIES), is(categories));
    }

    @Test
    public void updateWidget_valid() {
View Full Code Here

        String adminWidgetsView = controller.viewWidgets(DEFAULT_OFFSET, null, model);
        verify(service);
        assertEquals(ViewNames.ADMIN_WIDGETS, adminWidgetsView);
        assertEquals(widgetSearchResult, model.asMap().get(ModelKeys.SEARCHRESULT));
        assertTrue(model.containsAttribute(TABS));
    }

    @Test
    public void searchWidgets() throws Exception {
        Model model = new ExtendedModelMap();
View Full Code Here

        replay(service);
        String adminWidgetDetailView = controller.viewWidgetDetail(entityId, model);
        verify(service);

        assertEquals(ViewNames.ADMIN_WIDGETDETAIL, adminWidgetDetailView);
        assertTrue(model.containsAttribute(TABS));
        assertEquals(widget, model.asMap().get("widget"));
    }

    @Test
    public void updateWidget_valid() {
View Full Code Here

        String view = controller.view(model, REFERRER_ID, 0);

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat((Long) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
    }

    @Test
View Full Code Here

        String view = controller.viewWidget(model, WIDGET_ID, REFERRER_ID);

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.WIDGET)));
        assertThat(model.containsAttribute(ModelKeys.WIDGET), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
    }

    @Test
    public void searchWidgets() {
View Full Code Here

        verify(widgetService);

        assertEquals(ViewNames.STORE, view);
        final Map<String, Object> modelMap = model.asMap();
        assertEquals(searchTerm, modelMap.get(ModelKeys.SEARCH_TERM));
        assertTrue(model.containsAttribute(ModelKeys.WIDGETS));
        assertEquals(offset, modelMap.get(ModelKeys.OFFSET));
        assertEquals(result, modelMap.get(ModelKeys.WIDGETS));
    }

    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.