Package org.springframework.ui

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


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

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


        replay(service, categoryService);
        String adminWidgetDetailView = controller.viewWidgetDetail(entityId,REFERRER_ID, 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));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }
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));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }

    @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(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
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(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
        assertNull(model.asMap().get("widgetRating"));
View Full Code Here

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.WIDGET)));
        assertThat(model.containsAttribute(ModelKeys.WIDGET), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
        assertNull(model.asMap().get("widgetRating"));
View Full Code Here

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.WIDGET)));
        assertThat(model.containsAttribute(ModelKeys.WIDGET), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
        assertNull(model.asMap().get("widgetRating"));

    }
View Full Code Here

        assertThat(view, is(equalTo(ViewNames.WIDGET)));
        assertThat(model.containsAttribute(ModelKeys.WIDGET), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
        assertNull(model.asMap().get("widgetRating"));

    }
View Full Code Here

        String view = controller.viewCategoryResult(REFERRER_ID, categoryId, offset, model);

        verify(widgetService, tagService, categoryService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(model.containsAttribute(ModelKeys.OFFSET), is(true));
View Full Code Here

        String view = controller.viewCategoryResult(REFERRER_ID, categoryId, offset, model);

        verify(widgetService, tagService, categoryService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
        assertThat(model.containsAttribute(ModelKeys.REFERRING_PAGE_ID), is(true));
        assertThat(model.containsAttribute(ModelKeys.OFFSET), is(true));
        assertThat(model.containsAttribute(ModelKeys.SELECTED_CATEGORY), is(true));
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.