Code example for MockMvc

Methods: perform

0
    public void testLookupIdFromUsername() throws Exception { 
        String username = UaaTestAccounts.standard(null).getUserName(); 
 
        MockHttpServletRequestBuilder post = getIdLookupRequest(scimLookupIdUserToken, username, "eq"); 
 
        String body = mockMvc.perform(post) 
            .andExpect(status().isOk()) 
            .andReturn().getResponse().getContentAsString(); 
 
        validateLookupResults(new String[] {username}, body); 
    } 
 
    @Test 
    public void testLookupUsingOnlyOrigin() throws Exception { 
        String filter = "origin eq \"uaa\""; 
        MockHttpServletRequestBuilder post = post("/ids/Users") 
            .header("Authorization", "Bearer " + scimLookupIdUserToken) 
            .accept(APPLICATION_JSON) 
            .param("filter", filter) 
            .param("startIndex", String.valueOf(1))