@Test
public void test_getServiceAccountMeta_success() throws Exception {

    UserDetails userDetails = getMockUser(false);
    String token = userDetails.getClientToken();
    String path = "ad/roles/testacc01";
    String expected = "{\n" +
            "  \"app-roles\": {\n" +
            "    \"role1\": \"read\"\n" +
            "  },\n" +
            "  \"managedBy\": \"user11\",\n" +
            "  \"name\": \"testacc01\",\n" +
            "  \"users\": {\n" +
            "    \"user11\": \"sudo\"\n" +
            "  }\n" +
            "}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(expected);
    when(serviceAccountsService.getServiceAccountMeta(token, userDetails, path)).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.get("/v2/serviceaccounts/meta?path=ad/roles/testacc01").requestAttr("UserDetails", userDetails)
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8"))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(expected)));
}