Search in sources :

Example 1 with VdsSpmIdMapDao

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)

Aggregations

Arrays (java.util.Arrays)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Before (org.junit.Before)1 Test (org.junit.Test)1 InjectMocks (org.mockito.InjectMocks)1 Mock (org.mockito.Mock)1 Mockito.verify (org.mockito.Mockito.verify)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VdsSpmIdMap (org.ovirt.engine.core.common.businessentities.VdsSpmIdMap)1 Guid (org.ovirt.engine.core.compat.Guid)1 VdsSpmIdMapDao (org.ovirt.engine.core.dao.VdsSpmIdMapDao)1