Package org.springframework.ui

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


    //assert that the model size is two
    assertThat(model.size(), CoreMatchers.equalTo(2));

    //assert that the model does contain an attribute associated with User after setUpForm() is called
    assertThat(model.containsAttribute(User), CoreMatchers.equalTo(true));

    //assert that the model does not contain new user as null
    assertThat(model.get(User), CoreMatchers.notNullValue());
  }
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

        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

    //assert that the model size is four
    assertThat(model.size(), CoreMatchers.equalTo(modelSize));

    //assert that the model does contain an attribute associated with the authenticated user after setUpForm() is called
    assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));

    //assert that the model does not contain authenticated user as null
    assertThat(model.get(userProfile), CoreMatchers.notNullValue());

        assertThat(view, is(ViewNames.PERSON_PROFILE + "." + VALID_PAGE_LAYOUT_CODE));
View Full Code Here

    //assert that the model size is four
    assertThat(model.size(), CoreMatchers.equalTo(modelSize));

    //assert that the model does contain an attribute associated with the authenticated user after setUpForm() is called
    assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));

    //assert that the model does not contain authenticated user as null
    assertThat(model.get(userProfile), CoreMatchers.notNullValue());

        assertThat(view, is(ViewNames.PERSON_PROFILE + "." + VALID_PAGE_LAYOUT_CODE));
View Full Code Here

    //assert that the model size is three
    assertThat(model.size(), CoreMatchers.equalTo(modelSize));

    //assert that the model does contain an attribute associated with the authenticated user
    assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));

    //assert that the model does not contain authenticated user as null
    assertThat(model.get(userProfile), CoreMatchers.notNullValue());

    //assert that the status of user is updated
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

 
    //assert that the model size is three
    assertThat(model.size(), CoreMatchers.equalTo(modelSize));
   
    //assert that the model does contain an attribute associated with the authenticated user after setUpForm() is called
    assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));
   
    //assert that the model does not contain authenticated user as null
    assertThat(model.get(userProfile), CoreMatchers.notNullValue());

        assertThat(view, is(ViewNames.PERSON_PROFILE + "." + VALID_PAGE_LAYOUT_CODE));
View Full Code Here

 
    //assert that the model size is three
    assertThat(model.size(), CoreMatchers.equalTo(modelSize));
   
    //assert that the model does contain an attribute associated with the authenticated user
    assertThat(model.containsAttribute(userProfile), CoreMatchers.equalTo(true));
   
    //assert that the model does not contain authenticated user as null
    assertThat(model.get(userProfile), CoreMatchers.notNullValue());
   
    //assert that the status of user is updated
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.