@Test
public void test_createAppRole() throws Exception {

    String [] policies = {"default"};
    AppRole appRole = new AppRole("approle1", policies, true, 1, 100, 0);
    String inputJson =new ObjectMapper().writeValueAsString(appRole);
    String responseMessage = "{\"messages\":[\"AppRole created succssfully\"]}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseMessage);
    UserDetails userDetails = getMockUser(true);
    when(appRoleService.createAppRole(eq("5PDrOhsy4ig8L3EpsJZSLAMg"), Mockito.any(), eq(userDetails))).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/auth/approle/role").requestAttr("UserDetails", userDetails)
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8")
            .content(inputJson))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(responseMessage)));
}