use of org.apache.ranger.view.VXCredentialStoreList in project ranger by apache.
the class XCredentialStoreServiceBase method searchXCredentialStores.
/**
* @param searchCriteria
* @return
*/
public VXCredentialStoreList searchXCredentialStores(SearchCriteria searchCriteria) {
VXCredentialStoreList returnList = new VXCredentialStoreList();
List<VXCredentialStore> xCredentialStoreList = new ArrayList<VXCredentialStore>();
List<T> resultList = searchResources(searchCriteria, searchFields, sortFields, returnList);
// Iterate over the result list and create the return list
for (T gjXCredentialStore : resultList) {
VXCredentialStore vXCredentialStore = populateViewBean(gjXCredentialStore);
xCredentialStoreList.add(vXCredentialStore);
}
returnList.setVXCredentialStores(xCredentialStoreList);
return returnList;
}
use of org.apache.ranger.view.VXCredentialStoreList 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);
}
Aggregations