From 0198547e057acac6669de35dd5033db6f6a1e19e Mon Sep 17 00:00:00 2001 From: Oleg Muravskiy Date: Thu, 18 Nov 2021 14:05:07 +0100 Subject: [PATCH] Print EOR in the update type --- src/main/java/org/javamrt/mrt/EndOfRib.java | 2 +- src/test/java/org/javamrt/mrt/MrtTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/javamrt/mrt/EndOfRib.java b/src/main/java/org/javamrt/mrt/EndOfRib.java index b7e3a2f..8bbecbc 100644 --- a/src/main/java/org/javamrt/mrt/EndOfRib.java +++ b/src/main/java/org/javamrt/mrt/EndOfRib.java @@ -18,7 +18,7 @@ public String toString() { String peerString = MRTConstants.ipAddressString(this.peerIP, false); String attrString = updateAttr == null ? "" : updateAttr.toString(); - return String.format("%s|%s||%s|%s|%s", + return String.format("%s|%s|EOR|%s|%s|%s", updateStr, getTime(), peerString, peerAS, attrString); } } diff --git a/src/test/java/org/javamrt/mrt/MrtTest.java b/src/test/java/org/javamrt/mrt/MrtTest.java index fc52a2e..2158b91 100644 --- a/src/test/java/org/javamrt/mrt/MrtTest.java +++ b/src/test/java/org/javamrt/mrt/MrtTest.java @@ -176,7 +176,7 @@ public void should_parse_ipv4_end_of_rib() throws Exception { final BGPFileReader bgpFileReader = new BGPFileReader(stream); final MRTRecord mrtRecord = bgpFileReader.readNext(); assertEquals(mrtRecord.getClass(), EndOfRib.class); - assertEquals(mrtRecord.toString(), "BGP4MP|1527774250||187.16.220.193|263584|"); + assertEquals(mrtRecord.toString(), "BGP4MP|1527774250|EOR|187.16.220.193|263584|"); } @Test @@ -186,6 +186,6 @@ public void should_parse_ipv6_end_of_rib() throws Exception { final BGPFileReader bgpFileReader = new BGPFileReader(stream); final MRTRecord mrtRecord = bgpFileReader.readNext(); assertEquals(mrtRecord.getClass(), EndOfRib.class); - assertEquals(mrtRecord.toString(), "BGP4MP|1527839889||2001:df0:2e8:1000:0:0:0:1|45896|||255.255.255.255|0|0||NAG||"); + assertEquals(mrtRecord.toString(), "BGP4MP|1527839889|EOR|2001:df0:2e8:1000:0:0:0:1|45896|||255.255.255.255|0|0||NAG||"); } }