@Test
public void test_getFoldersRecursively_successfully() {

    String path = "shared/mysafe01";
    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    UserDetails userDetails = getMockUser(false);
    String[] policies = {"s_shared_mysafe01"};
    String[] safes = {"mysafe01"};
    String responseJson = "{\"keys\":[\"mysafe01\"]}";
    ResponseEntity<String> response = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    when(policyUtils.getCurrentPolicies(Mockito.any(), eq("normaluser"), Mockito.any())).thenReturn(policies);
    when(safeUtils.getManagedSafes(policies, path)).thenReturn(safes);
    when(safesService.getFoldersRecursively(token, path)).thenReturn(response);
    when(JSONUtil.getJSON(Mockito.any(HashMap.class))).thenReturn("{\"keys\":[\"mysafe01\"]}");
    ResponseEntity<String> responseEntity = selfSupportService.getFoldersRecursively(userDetails, token, path);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}