Package org.springframework.ui

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


        assertEquals(categories, model.asMap().get("categories"));
        assertTrue(model.containsAttribute("actionresult"));
        assertEquals(CREATE, model.asMap().get("actionresult"));
        assertTrue(model.containsAttribute("category"));
        assertEquals("Check category object available", new CategoryImpl(), model.asMap().get("category"));
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
    }

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


        assertTrue(model.containsAttribute("actionresult"));
        assertEquals(CREATE, model.asMap().get("actionresult"));
        assertTrue(model.containsAttribute("category"));
        assertEquals("Check category object available", new CategoryImpl(), model.asMap().get("category"));
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
    }

    @Test
    public void createCategory_valid(){
        Model model = new ExtendedModelMap();
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

        replay(userService);

        String adminUsersView = controller.viewUsers(offset, referer, model);
        assertEquals(ViewNames.ADMIN_USERS, adminUsersView);
        assertEquals(searchResult, model.asMap().get(ModelKeys.SEARCHRESULT));
        assertTrue(model.containsAttribute(TABS));
    }

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

        String adminUsersView = controller.searchUsers(searchTerm, offset, 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));
    }


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

        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

        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

        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));

    }

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