@Test
  public void testExecuteQueryWithDirectOnly() {
    PermissionDAO permissionDAOMock = mock(PermissionDAO.class);
    when(permissionDAOMock.getAllForEntity(
            objectID, getUser().getId(), getQueryParameters().isFiltered(), false))
        .thenReturn(mockedPermissions);
    when(getDbFacadeMockInstance().getPermissionDao()).thenReturn(permissionDAOMock);

    assertQueryDAOCall(true);
  }
  @Test
  public void testExecuteQueryWithoutDirectOnly() {
    VdcObjectType type = RandomUtils.instance().pickRandom(VdcObjectType.values());
    when(getQueryParameters().getVdcObjectType()).thenReturn(type);

    PermissionDAO permissionDAOMock = mock(PermissionDAO.class);
    when(permissionDAOMock.getTreeForEntity(
            objectID, type, getUser().getId(), getQueryParameters().isFiltered()))
        .thenReturn(mockedPermissions);
    when(getDbFacadeMockInstance().getPermissionDao()).thenReturn(permissionDAOMock);

    assertQueryDAOCall(false);
  }