Package org.springframework.ui

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


        replay(service);
        String view = controller.editPreferences(model,REFERRER_ID);
        assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);

        assertTrue(model.asMap().get("preferenceForm") instanceof PortalPreferenceForm);
        assertTrue(model.containsAttribute(ModelKeys.TOKENCHECK));
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }
View Full Code Here


        String view = controller.editPreferences(model,REFERRER_ID);
        assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);

        assertTrue(model.asMap().get("preferenceForm") instanceof PortalPreferenceForm);
        assertTrue(model.containsAttribute(ModelKeys.TOKENCHECK));
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }

    @Test
View Full Code Here

        assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);

        assertTrue(model.asMap().get("preferenceForm") instanceof PortalPreferenceForm);
        assertTrue(model.containsAttribute(ModelKeys.TOKENCHECK));
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }

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

        replay(service, sessionStatus);
        String view = controller.updatePreferences(form, errors, validToken, validToken,REFERRER_ID, model, sessionStatus);

        assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);
        assertTrue(errors.hasErrors());
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
        assertFalse("Model has not been cleared", model.isEmpty());

        verify(service, sessionStatus);
    }
View Full Code Here

        String view = controller.updatePreferences(form, errors, validToken, validToken,REFERRER_ID, model, sessionStatus);

        assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);
        assertTrue(errors.hasErrors());
        assertTrue(model.containsAttribute("topnav"));
        assertTrue(model.containsAttribute("tabs"));
        assertFalse("Model has not been cleared", model.isEmpty());

        verify(service, sessionStatus);
    }
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

        String adminUserDetailView = controller.viewUserDetail(userid,REFERRER_ID, model);
        verify(userService);

        assertEquals(ViewNames.ADMIN_USERDETAIL, adminUserDetailView);
        assertTrue(model.containsAttribute(TABS));
        assertEquals(user, model.asMap().get("user"));
        assertThat((String) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
    }

View Full Code Here

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

    @Test
View Full Code Here

        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

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.