Code example for MockMvc

Methods: perform

0
        profile.setGithubUsername("someguy"); 
        profile.setUsername("someguy"); 
 
        teamRepository.save(profile); 
 
        mockMvc.perform(get("/team/someguy")) 
                .andExpect(status().isOk()) 
                .andExpect(content().contentTypeCompatibleWith("text/html")) 
                .andExpect(content().string(containsString("First Last"))) 
                .andExpect(content().string(containsString("someguy"))); 
    } 
 
    @Test 
    public void getTeamMemberPage_404sWhenNoMemberFound() throws Exception { 
        mockMvc.perform(get("/team/not-a-user")).andExpect(status().isNotFound()); 
    } 
 
    @Test 
    public void getTeamMemberPage_404sWhenMemberIsHidden() throws Exception { 
        MemberProfile profile = new MemberProfile();