Search in sources :

Example 21 with RangerPolicyList

use of org.apache.ranger.view.RangerPolicyList in project ranger by apache.

the class TestServiceDBStore method test30getPolicies.

@Test
public void test30getPolicies() throws Exception {
    SearchFilter filter = new SearchFilter();
    filter.setParam(SearchFilter.POLICY_NAME, "policyName");
    filter.setParam(SearchFilter.SERVICE_NAME, "serviceName");
    List<RangerPolicy> rangerPolicyLists = new ArrayList<RangerPolicy>();
    RangerPolicy rangerPolicy = rangerPolicy();
    rangerPolicyLists.add(rangerPolicy);
    RangerPolicyList policyListObj = new RangerPolicyList();
    policyListObj.setPageSize(0);
    policyListObj.setResultSize(1);
    policyListObj.setSortBy("asc");
    policyListObj.setSortType("1");
    policyListObj.setStartIndex(0);
    policyListObj.setTotalCount(10);
    List<RangerPolicy> dbRangerPolicy = serviceDBStore.getPolicies(filter);
    Assert.assertNotNull(dbRangerPolicy);
}
Also used : RangerPolicy(org.apache.ranger.plugin.model.RangerPolicy) ArrayList(java.util.ArrayList) SearchFilter(org.apache.ranger.plugin.util.SearchFilter) RangerPolicyList(org.apache.ranger.view.RangerPolicyList) Test(org.junit.Test)

Aggregations

RangerPolicyList (org.apache.ranger.view.RangerPolicyList)21 RangerPolicy (org.apache.ranger.plugin.model.RangerPolicy)17 SearchFilter (org.apache.ranger.plugin.util.SearchFilter)14 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)9 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 VXString (org.apache.ranger.view.VXString)5 GET (javax.ws.rs.GET)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 RangerService (org.apache.ranger.plugin.model.RangerService)3 HashSet (java.util.HashSet)2 WebApplicationException (javax.ws.rs.WebApplicationException)2 RangerPolicyValidator (org.apache.ranger.plugin.model.validation.RangerPolicyValidator)2 RangerPerfTracer (org.apache.ranger.plugin.util.RangerPerfTracer)2 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 XXPolicy (org.apache.ranger.entity.XXPolicy)1 XXService (org.apache.ranger.entity.XXService)1