use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.GetMacInputBuilder in project genius by opendaylight.
the class ArpUtilTest method testGetMac.
@Test
public void testGetMac() throws Exception {
final InterfaceAddress interfaceAddress = new InterfaceAddressBuilder().setInterface(INTERFACE_NAME).setIpAddress(new IpAddress(Ipv4Address.getDefaultInstance("192.168.0.1"))).setMacaddress(new PhysAddress("1F:1F:1F:1F:1F:1F")).build();
final List<InterfaceAddress> itf = Arrays.asList(interfaceAddress);
GetMacInput getMacInput = new GetMacInputBuilder().setIpaddress(new IpAddress(Ipv4Address.getDefaultInstance("192.168.0.2"))).setInterfaceAddress(itf).build();
// request payload
PacketReceived packetReceived = ArpUtilTestUtil.createPayload(0);
Future<RpcResult<GetMacOutput>> output = odlArputilService.getMac(getMacInput);
arpUtil.onPacketReceived(packetReceived);
Assert.assertEquals("00:01:02:03:04:05", output.get().getResult().getMacaddress().getValue());
}
Aggregations