use of org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping in project ovirt-engine by oVirt.
the class MatchUserMappingToOvfVnicTest method test.
private void test(Object[] dataPoint, int count) {
// Translate input to human readable
VmNetworkInterface ovfVnicUnderTest = (VmNetworkInterface) dataPoint[0];
ExternalVnicProfileMapping userMappingUnderTest = (ExternalVnicProfileMapping) dataPoint[1];
Boolean expectedIsMatch = (Boolean) dataPoint[2];
// Arrange
MapVnicsContext ctx = new MapVnicsContext("test");
ctx.setOvfVnics(singletonList(ovfVnicUnderTest));
ctx.setUserMappings(singletonList(userMappingUnderTest));
// Act
matcher.handle(ctx);
// Assert
print(ovfVnicUnderTest, ctx, count);
ExternalVnicProfileMapping expectedMatchingMapping = expectedIsMatch ? userMappingUnderTest : null;
assertEquals(expectedMatchingMapping, ctx.getMatched().get(ovfVnicUnderTest));
assertTrue(ctx.getMatched().size() > 0);
assertTrue(ctx.getException() == null);
}
use of org.ovirt.engine.core.common.businessentities.network.ExternalVnicProfileMapping in project ovirt-engine by oVirt.
the class MatchUserMappingToOvfVnicTest method setUp.
@Before
public void setUp() {
underTest = new MatchUserMappingToOvfVnic();
externalVnicProfileMapping1 = new ExternalVnicProfileMapping(NETWORK_NAME, VNIC_PROFILE1_NAME, TARGET_VNIC_PROFILE_ID);
externalVnicProfileMapping2 = new ExternalVnicProfileMapping(NETWORK_NAME, VNIC_PROFILE2_NAME, null);
externalVnicProfileMappings = asList(externalVnicProfileMapping1, externalVnicProfileMapping2);
emptySourceMapping = new ExternalVnicProfileMapping(null, null, TARGET_VNIC_PROFILE_ID);
}
Aggregations