Code example for MockMvc

Methods: perform

0
 
    @Test 
    public void creationOfTGTWithAuthenticationException() throws Throwable { 
        configureCasMockTGTCreationToThrowAuthenticationException(); 
 
        this.mockMvc.perform(post("/cas/v1/tickets") 
                .param("username", "test") 
                .param("password", "test")) 
                .andExpect(status().is4xxClientError()) 
                .andExpect(content().string("1 errors, 0 successes")); 
    } 
 
    @Test 
    public void normalCreationOfST() throws Throwable { 
        configureCasMockToCreateValidST(); 
 
        this.mockMvc.perform(post("/cas/v1/tickets/TGT-1") 
                .param("service", "https://www.google.com")) 
                .andExpect(status().isOk()) 
                .andExpect(content().contentType("text/plain;charset=ISO-8859-1")) 
Contextual code suggestions in your IDE  Get Codota for Java