mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-1360 - Filter sites by visibility - add automated test for NOT in where clause
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@131278 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -881,6 +881,18 @@ public class TestPersonSites extends EnterpriseTestApi
|
|||||||
|
|
||||||
return getSiteMembershipsForPersonAndNetwork(paging, params, person41, network4, runAsUserTenant);
|
return getSiteMembershipsForPersonAndNetwork(paging, params, person41, network4, runAsUserTenant);
|
||||||
}
|
}
|
||||||
|
private ListResponse<MemberOfSite> getSiteMembershipsForPerson41NOTWhere(final Paging paging, String siteVisibility, boolean runAsUserTenant) throws Exception
|
||||||
|
{
|
||||||
|
final Map<String, String> params = new HashMap<>();
|
||||||
|
params.put("orderBy", "title" + " " + "ASC");
|
||||||
|
|
||||||
|
if (siteVisibility != null)
|
||||||
|
{
|
||||||
|
params.put("where", "(NOT visibility=" + siteVisibility + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
return getSiteMembershipsForPersonAndNetwork(paging, params, person41, network4, runAsUserTenant);
|
||||||
|
}
|
||||||
|
|
||||||
private ListResponse<MemberOfSite> getSiteMembershipsForPerson41(final Paging paging, String siteVisibility) throws Exception
|
private ListResponse<MemberOfSite> getSiteMembershipsForPerson41(final Paging paging, String siteVisibility) throws Exception
|
||||||
{
|
{
|
||||||
@@ -962,6 +974,19 @@ public class TestPersonSites extends EnterpriseTestApi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testGetSiteMembershipsWhereSiteVisibilityNOTIncluded() throws Exception
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getSiteMembershipsForPerson41NOTWhere(null, SiteVisibility.MODERATED.name(), false);
|
||||||
|
fail("");
|
||||||
|
}
|
||||||
|
catch (PublicApiException e)
|
||||||
|
{
|
||||||
|
assertEquals(HttpStatus.SC_BAD_REQUEST, e.getHttpResponse().getStatusCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSiteMembershipsWithWhereClause() throws Exception
|
public void testGetSiteMembershipsWithWhereClause() throws Exception
|
||||||
{
|
{
|
||||||
@@ -973,6 +998,7 @@ public class TestPersonSites extends EnterpriseTestApi
|
|||||||
testGetSiteMembershipsWhereSiteVisibilityPublicAndSkipCount();
|
testGetSiteMembershipsWhereSiteVisibilityPublicAndSkipCount();
|
||||||
testGetSiteMembershipsWhereSiteVisibilityModerated();
|
testGetSiteMembershipsWhereSiteVisibilityModerated();
|
||||||
testGetSiteMembershipsWhereSiteVisibilityInvalid();
|
testGetSiteMembershipsWhereSiteVisibilityInvalid();
|
||||||
|
testGetSiteMembershipsWhereSiteVisibilityNOTIncluded();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user