Package org.springframework.ui

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


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

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
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(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
View Full Code Here

        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));

    }

    @Test
View Full Code Here

        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));

    }

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

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

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
View Full Code Here

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

        verify(widgetService);
        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));
View Full Code Here

        assertThat(view, is(equalTo(ViewNames.STORE)));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));

    }

    @Test
View Full Code Here

        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
        assertThat(model.containsAttribute(ModelKeys.TAGS), is(true));
        assertThat(model.containsAttribute(ModelKeys.CATEGORIES), is(true));

    }

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

        replay(userService);

        String adminUsersView = controller.viewUsers(offset, referer,REFERRER_ID, model);
        assertEquals(ViewNames.ADMIN_USERS, adminUsersView);
        assertEquals(searchResult, 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 searchUsers() throws Exception {
View Full Code Here

        String adminUsersView = controller.searchUsers(searchTerm, offset,REFERRER_ID, model);
        assertEquals(ViewNames.ADMIN_USERS, adminUsersView);
        assertEquals(searchResult, model.asMap().get(ModelKeys.SEARCHRESULT));
        assertEquals(searchTerm, model.asMap().get(ModelKeys.SEARCH_TERM));
        assertTrue(model.containsAttribute(TABS));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }


    @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.