use of org.ovirt.engine.core.dao.VdsSpmIdMapDao in project ovirt-engine by oVirt.
the class AddVdsSpmIdCommandTest method insertSpmIdToDb.
private void insertSpmIdToDb(int expected, int... given) {
List<VdsSpmIdMap> list = Arrays.stream(given).mapToObj(i -> new VdsSpmIdMap(spId, vdsId, i)).collect(Collectors.toList());
cmd.insertSpmIdToDb(list);
verify(vdsSpmIdMapDao).save(new VdsSpmIdMap(spId, vdsId, expected));
}
Also used :
InjectMocks(org.mockito.InjectMocks)
VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters)
VdsSpmIdMap(org.ovirt.engine.core.common.businessentities.VdsSpmIdMap)
Arrays(java.util.Arrays)
Mock(org.mockito.Mock)
Guid(org.ovirt.engine.core.compat.Guid)
Test(org.junit.Test)
Collectors(java.util.stream.Collectors)
Mockito.verify(org.mockito.Mockito.verify)
List(java.util.List)
VDS(org.ovirt.engine.core.common.businessentities.VDS)
VdsSpmIdMapDao(org.ovirt.engine.core.dao.VdsSpmIdMapDao)
Before(org.junit.Before)
VdsSpmIdMap(org.ovirt.engine.core.common.businessentities.VdsSpmIdMap)