use of org.apache.ranger.view.VXCredentialStore in project ranger by apache.
the class TestAssetREST method vXCredentialStore.
private VXCredentialStore vXCredentialStore() {
VXCredentialStore vXCredentialStore = new VXCredentialStore();
vXCredentialStore.setId(Id);
vXCredentialStore.setName("TestAssetRest");
vXCredentialStore.setDescription("TestAssetRest");
vXCredentialStore.setOwner("owner");
return vXCredentialStore;
}
use of org.apache.ranger.view.VXCredentialStore in project ranger by apache.
the class TestAssetREST method testGetXCredentialStore.
@Test
public void testGetXCredentialStore() {
VXCredentialStore vXCredentialStore = vXCredentialStore();
Mockito.when(assetMgr.getXCredentialStore(Id)).thenReturn(vXCredentialStore);
VXCredentialStore actualvXCredentialStore = assetREST.getXCredentialStore(Id);
Assert.assertNotNull(actualvXCredentialStore);
Assert.assertEquals(vXCredentialStore, actualvXCredentialStore);
Mockito.verify(assetMgr).getXCredentialStore(Id);
}
use of org.apache.ranger.view.VXCredentialStore in project ranger by apache.
the class TestAssetREST method testUpdateXCredentialStoree.
@Test
public void testUpdateXCredentialStoree() {
VXCredentialStore vXCredentialStore = vXCredentialStore();
Mockito.when(assetMgr.updateXCredentialStore(vXCredentialStore)).thenReturn(vXCredentialStore);
VXCredentialStore actualvXCredentialStore = assetREST.updateXCredentialStore(vXCredentialStore);
Assert.assertNotNull(actualvXCredentialStore);
Assert.assertEquals(vXCredentialStore, actualvXCredentialStore);
Mockito.verify(assetMgr).updateXCredentialStore(vXCredentialStore);
}
use of org.apache.ranger.view.VXCredentialStore 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.VXCredentialStore 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