use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4 in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withApplicationDataIpv4Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with ApplicationData type Ipv4 address.
*/
@Test
public void getTransportAddressFromRlocTest_withApplicationDataIpv4Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(PORT)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_APPLICATION_DATA_IPV4));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4 in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withIpv4Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with Ipv4 type address.
*/
@Test
public void getTransportAddressFromRlocTest_withIpv4Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(LispMessage.PORT_NUM)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_IPV4));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4 in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getMappingTest_SiteIdNotPresent.
/**
* Tests {@link LispNotificationHelper#getMapping} method with invalid address, isXtrSiteIdPresent == false.
*/
@Test
public void getMappingTest_SiteIdNotPresent() {
final MappingBuilder mappingBuilder_1 = new MappingBuilder().setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build()).setEidUri(new EidUri("ipv4:" + IPV4_STRING)).setOrigin(MappingOrigin.Southbound);
final MappingBuilder mappingBuilder_2 = new MappingBuilder().setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV6).build()).setEidUri(new EidUri("ipv6:" + IPV6_STRING)).setOrigin(MappingOrigin.Southbound);
assertEquals(Lists.newArrayList(mappingBuilder_1.build(), mappingBuilder_2.build()), LispNotificationHelper.getMapping(getDefaultAddMapping(false)));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4 in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method addXtrIdMappingTest.
/**
* Tests {@link DataStoreBackEnd#addXtrIdMapping} method.
*/
@Test
public void addXtrIdMappingTest() {
XtrIdMapping xtrIdMapping = new XtrIdMappingBuilder().setXtrIdUri(new XtrIdUri(DUMMY_URI)).setMappingRecord(getDefaultMappingRecordBuilder().build()).build();
dataStoreBackEnd.addXtrIdMapping(xtrIdMapping);
Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.OPERATIONAL), iidCaptorXtrIdMapping.capture(), Mockito.eq(xtrIdMapping), Mockito.eq(true));
// result
XtrIdMappingKey xtrIdResult = iidCaptorXtrIdMapping.getValue().firstKeyOf(XtrIdMapping.class);
MappingKey mappingResult = iidCaptorXtrIdMapping.getValue().firstKeyOf(Mapping.class);
assertEquals(DatatypeConverter.printHexBinary(XTR_ID), xtrIdResult.getXtrIdUri().getValue());
assertEquals(MappingOrigin.Southbound, mappingResult.getOrigin());
assertEquals("ipv4:" + IPV4_STRING_1, mappingResult.getEidUri().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4 in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method updateAuthenticationKeyTest.
/**
* Tests {@link DataStoreBackEnd#updateAuthenticationKey} method.
*/
@Test
public void updateAuthenticationKeyTest() {
final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
dataStoreBackEnd.updateAuthenticationKey(authenticationKey);
Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey), Mockito.eq(true));
// result
AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
Aggregations