Search in sources :

Example 61 with SearchCriteria

use of org.apache.ranger.common.SearchCriteria in project ranger by apache.

the class TestAssetREST method testSearchXCredentialStores.

@Test
public void testSearchXCredentialStores() {
    VXCredentialStore vXCredentialStore = vXCredentialStore();
    List<VXCredentialStore> vXCredentialStores = Arrays.asList(vXCredentialStore);
    VXCredentialStoreList vXCredentialStoreList = new VXCredentialStoreList();
    vXCredentialStoreList.setVXCredentialStores(vXCredentialStores);
    SearchCriteria searchCriteria = new SearchCriteria();
    List<SortField> sortFields = null;
    Mockito.when(searchUtil.extractCommonCriterias(request, sortFields)).thenReturn(searchCriteria);
    Mockito.when(assetMgr.searchXCredentialStores(searchCriteria)).thenReturn(vXCredentialStoreList);
    VXCredentialStoreList actualvxCredentialStoreList = assetREST.searchXCredentialStores(request);
    Assert.assertEquals(vXCredentialStoreList.getVXCredentialStores(), actualvxCredentialStoreList.getVXCredentialStores());
    Mockito.verify(assetMgr).searchXCredentialStores(searchCriteria);
}
Also used : VXCredentialStoreList(org.apache.ranger.view.VXCredentialStoreList) VXCredentialStore(org.apache.ranger.view.VXCredentialStore) SortField(org.apache.ranger.common.SortField) SearchCriteria(org.apache.ranger.common.SearchCriteria) Test(org.junit.Test)

Aggregations

SearchCriteria (org.apache.ranger.common.SearchCriteria)61 Test (org.junit.Test)29 SortField (org.apache.ranger.common.SortField)27 ArrayList (java.util.ArrayList)22 HttpServletRequest (javax.servlet.http.HttpServletRequest)20 GET (javax.ws.rs.GET)13 Path (javax.ws.rs.Path)12 Produces (javax.ws.rs.Produces)12 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)12 VXLong (org.apache.ranger.view.VXLong)10 Date (java.util.Date)9 DateUtil (org.apache.ranger.common.DateUtil)6 HashMap (java.util.HashMap)4 XXPortalUser (org.apache.ranger.entity.XXPortalUser)4 RangerPolicy (org.apache.ranger.plugin.model.RangerPolicy)4 RangerPolicyItem (org.apache.ranger.plugin.model.RangerPolicy.RangerPolicyItem)4 VXPermMap (org.apache.ranger.view.VXPermMap)4 VXUserList (org.apache.ranger.view.VXUserList)4 List (java.util.List)3 XXServiceDef (org.apache.ranger.entity.XXServiceDef)3