@Test
@WithMockUser(username="tester", authorities={"READ_ROLE", "CREATE_ROLE", "DELETE_ROLE", "UPDATE_ROLE"})

public void notPermitToPersistRoleWithPrivilegesMissing() throws Exception {
     Role role = new Role();
     role.setId(100L);
     Mockito.when(service.save(Mockito.any(RoleDTO.class))).thenReturn(role);
     
     mockMvc.perform(MockMvcRequestBuilders.post(ConstantsPath.PATH_ROLES)
               .content("{\"name\":\"\",\"privileges\":[{\"id\":5},{\"id\":2},{\"id\":10}]}")
               .contentType(MediaType.APPLICATION_JSON))
               .andExpect(MockMvcResultMatchers.status().is4xxClientError())
               .andExpect(MockMvcResultMatchers.content().json("{\"status\":400,\"exception\":\"MethodArgumentNotValidException\",\"erros\":[{\"defaultMessage\":\"size must be between 6 and 80\",\"objectName\":\"roleDTO\",\"field\":\"name\",\"code\":\"Size\"}]}"));
}