@Test
public void test_getADServiceAccounts_success() throws Exception {

    UserDetails userDetails = getMockUser(false);
    String token = userDetails.getClientToken();
    String svcAccName = "testacc01";
    List<ADServiceAccount> allServiceAccounts = generateADSerivceAccounts();
    ADServiceAccountObjects adServiceAccountObjects = generateADServiceAccountObjects(allServiceAccounts);
    ResponseEntity<ADServiceAccountObjects> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(adServiceAccountObjects);
    when(serviceAccountsService.getADServiceAccounts(token, userDetails, svcAccName, true)).thenReturn(responseEntityExpected);
    
    MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get("/v2/ad/serviceaccounts")
            .header("vault-token", token)
            .header("Content-Type", "application/json;charset=UTF-8")
            .requestAttr("UserDetails", userDetails)
            .param("serviceAccountName", svcAccName))
    		.andExpect(status().isOk()).andReturn();
    String actual = result.getResponse().getContentAsString();
    String expected = getJSON(adServiceAccountObjects);
    assertEquals(expected, actual);
}