Jian Li
Committed by Gerrit Code Review

Remove recordCount and locatorCount from LISP control message class

Because recordCount or locatorCount is only used when decoding the
LISP control message received from xTR, therefore, there is no
need to provide any interface to specify this value from obj builder.

Change-Id: I380b275e6f06feb4846b84f62ebf2430ad5a9ec6
......@@ -39,7 +39,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
private final short keyId;
private final short authDataLength;
private final byte[] authenticationData;
private final byte recordCount;
private final List<LispMapRecord> mapRecords;
/**
......@@ -48,17 +47,14 @@ public final class DefaultLispMapNotify implements LispMapNotify {
* @param nonce nonce
* @param keyId key identifier
* @param authenticationData authentication data
* @param recordCount record count number
* @param mapRecords a collection of map records
*/
private DefaultLispMapNotify(long nonce, short keyId, short authDataLength,
byte[] authenticationData, byte recordCount,
List<LispMapRecord> mapRecords) {
byte[] authenticationData, List<LispMapRecord> mapRecords) {
this.nonce = nonce;
this.keyId = keyId;
this.authDataLength = authDataLength;
this.authenticationData = authenticationData;
this.recordCount = recordCount;
this.mapRecords = mapRecords;
}
......@@ -83,8 +79,8 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
@Override
public byte getRecordCount() {
return recordCount;
public int getRecordCount() {
return mapRecords.size();
}
@Override
......@@ -116,7 +112,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
return toStringHelper(this)
.add("type", getType())
.add("nonce", nonce)
.add("recordCount", recordCount)
.add("keyId", keyId)
.add("authentication data length", authDataLength)
.add("authentication data", authenticationData)
......@@ -133,7 +128,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
DefaultLispMapNotify that = (DefaultLispMapNotify) o;
return Objects.equal(nonce, that.nonce) &&
Objects.equal(recordCount, that.recordCount) &&
Objects.equal(keyId, that.keyId) &&
Objects.equal(authDataLength, that.authDataLength) &&
Arrays.equals(authenticationData, that.authenticationData);
......@@ -141,7 +135,7 @@ public final class DefaultLispMapNotify implements LispMapNotify {
@Override
public int hashCode() {
return Objects.hashCode(nonce, recordCount, keyId, authDataLength) +
return Objects.hashCode(nonce, keyId, authDataLength) +
Arrays.hashCode(authenticationData);
}
......@@ -151,7 +145,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
private short keyId;
private short authDataLength;
private byte[] authenticationData;
private byte recordCount;
private List<LispMapRecord> mapRecords = Lists.newArrayList();
@Override
......@@ -166,12 +159,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
@Override
public NotifyBuilder withRecordCount(byte recordCount) {
this.recordCount = recordCount;
return this;
}
@Override
public NotifyBuilder withKeyId(short keyId) {
this.keyId = keyId;
return this;
......@@ -209,7 +196,7 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
return new DefaultLispMapNotify(nonce, keyId, authDataLength,
authenticationData, recordCount, mapRecords);
authenticationData, mapRecords);
}
}
......@@ -252,7 +239,6 @@ public final class DefaultLispMapNotify implements LispMapNotify {
}
return new DefaultNotifyBuilder()
.withRecordCount(recordCount)
.withNonce(nonce)
.withKeyId(keyId)
.withAuthDataLength(authLength)
......@@ -283,7 +269,7 @@ public final class DefaultLispMapNotify implements LispMapNotify {
byteBuf.writeShort((short) UNUSED_ZERO);
// record count
byteBuf.writeByte(message.getRecordCount());
byteBuf.writeByte(message.getMapRecords().size());
// nonce
byteBuf.writeLong(message.getNonce());
......
......@@ -38,7 +38,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispLocatorRecord.Locato
public final class DefaultLispMapRecord implements LispMapRecord {
private final int recordTtl;
private final int locatorCount;
private final byte maskLength;
private final LispMapReplyAction action;
private final boolean authoritative;
......@@ -50,19 +49,17 @@ public final class DefaultLispMapRecord implements LispMapRecord {
* A private constructor that protects object instantiation from external.
*
* @param recordTtl record time-to-live value
* @param locatorCount locator's count number
* @param maskLength mask length
* @param action lisp map reply action
* @param authoritative authoritative flag
* @param mapVersionNumber map version number
* @param eidPrefixAfi EID prefix AFI address
*/
private DefaultLispMapRecord(int recordTtl, int locatorCount, byte maskLength,
private DefaultLispMapRecord(int recordTtl, byte maskLength,
LispMapReplyAction action, boolean authoritative,
short mapVersionNumber, LispAfiAddress eidPrefixAfi,
List<LispLocatorRecord> locatorRecords) {
this.recordTtl = recordTtl;
this.locatorCount = locatorCount;
this.maskLength = maskLength;
this.action = action;
this.authoritative = authoritative;
......@@ -78,7 +75,7 @@ public final class DefaultLispMapRecord implements LispMapRecord {
@Override
public int getLocatorCount() {
return locatorCount;
return locatorRecords.size();
}
@Override
......@@ -120,7 +117,6 @@ public final class DefaultLispMapRecord implements LispMapRecord {
public String toString() {
return toStringHelper(this)
.add("record TTL", recordTtl)
.add("locatorCount", locatorCount)
.add("maskLength", maskLength)
.add("action", action)
.add("authoritative", authoritative)
......@@ -140,7 +136,6 @@ public final class DefaultLispMapRecord implements LispMapRecord {
}
DefaultLispMapRecord that = (DefaultLispMapRecord) o;
return Objects.equal(recordTtl, that.recordTtl) &&
Objects.equal(locatorCount, that.locatorCount) &&
Objects.equal(maskLength, that.maskLength) &&
Objects.equal(action, that.action) &&
Objects.equal(authoritative, that.authoritative) &&
......@@ -151,14 +146,13 @@ public final class DefaultLispMapRecord implements LispMapRecord {
@Override
public int hashCode() {
return Objects.hashCode(recordTtl, locatorCount, maskLength, action,
return Objects.hashCode(recordTtl, maskLength, action,
authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords);
}
public static final class DefaultMapRecordBuilder implements MapRecordBuilder {
private int recordTtl;
private int locatorCount;
private byte maskLength;
private LispMapReplyAction action;
private boolean authoritative;
......@@ -173,12 +167,6 @@ public final class DefaultLispMapRecord implements LispMapRecord {
}
@Override
public MapRecordBuilder withLocatorCount(int locatorCount) {
this.locatorCount = locatorCount;
return this;
}
@Override
public MapRecordBuilder withMaskLength(byte maskLength) {
this.maskLength = maskLength;
return this;
......@@ -221,8 +209,8 @@ public final class DefaultLispMapRecord implements LispMapRecord {
checkNotNull(eidPrefixAfi, "Must specify an EID prefix");
return new DefaultLispMapRecord(recordTtl, locatorCount, maskLength,
action, authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords);
return new DefaultLispMapRecord(recordTtl, maskLength, action,
authoritative, mapVersionNumber, eidPrefixAfi, locatorRecords);
}
}
......@@ -275,7 +263,6 @@ public final class DefaultLispMapRecord implements LispMapRecord {
return new DefaultMapRecordBuilder()
.withRecordTtl(recordTtl)
.withLocatorCount(locatorCount)
.withMaskLength(maskLength)
.withAction(action)
.withAuthoritative(authoritative)
......@@ -304,7 +291,7 @@ public final class DefaultLispMapRecord implements LispMapRecord {
byteBuf.writeInt(message.getRecordTtl());
// locator count
byteBuf.writeByte((byte) message.getLocatorCount());
byteBuf.writeByte((byte) message.getLocators().size());
// EID mask length
byteBuf.writeByte(message.getMaskLength());
......
......@@ -42,7 +42,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
private final short keyId;
private final short authDataLength;
private final byte[] authenticationData;
private final byte recordCount;
private final List<LispMapRecord> mapRecords;
private final boolean proxyMapReply;
private final boolean wantMapNotify;
......@@ -53,20 +52,17 @@ public final class DefaultLispMapRegister implements LispMapRegister {
* @param nonce nonce
* @param keyId key identifier
* @param authenticationData authentication data
* @param recordCount record count number
* @param mapRecords a collection of map records
* @param proxyMapReply proxy map reply flag
* @param wantMapNotify want map notify flag
*/
private DefaultLispMapRegister(long nonce, short keyId, short authDataLength,
byte[] authenticationData, byte recordCount,
List<LispMapRecord> mapRecords,
byte[] authenticationData, List<LispMapRecord> mapRecords,
boolean proxyMapReply, boolean wantMapNotify) {
this.nonce = nonce;
this.keyId = keyId;
this.authDataLength = authDataLength;
this.authenticationData = authenticationData;
this.recordCount = recordCount;
this.mapRecords = mapRecords;
this.proxyMapReply = proxyMapReply;
this.wantMapNotify = wantMapNotify;
......@@ -98,8 +94,8 @@ public final class DefaultLispMapRegister implements LispMapRegister {
}
@Override
public byte getRecordCount() {
return recordCount;
public int getRecordCount() {
return mapRecords.size();
}
@Override
......@@ -136,7 +132,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
return toStringHelper(this)
.add("type", getType())
.add("nonce", nonce)
.add("recordCount", recordCount)
.add("keyId", keyId)
.add("authentication data length", authDataLength)
.add("authentication data", authenticationData)
......@@ -156,7 +151,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
DefaultLispMapRegister that = (DefaultLispMapRegister) o;
return Objects.equal(nonce, that.nonce) &&
Objects.equal(recordCount, that.recordCount) &&
Objects.equal(keyId, that.keyId) &&
Objects.equal(authDataLength, that.authDataLength) &&
Arrays.equals(authenticationData, that.authenticationData) &&
......@@ -166,7 +160,7 @@ public final class DefaultLispMapRegister implements LispMapRegister {
@Override
public int hashCode() {
return Objects.hashCode(nonce, recordCount, keyId, authDataLength,
return Objects.hashCode(nonce, keyId, authDataLength,
proxyMapReply, wantMapNotify) + Arrays.hashCode(authenticationData);
}
......@@ -176,7 +170,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
private short keyId;
private short authDataLength;
private byte[] authenticationData = new byte[0];
private byte recordCount;
private List<LispMapRecord> mapRecords = Lists.newArrayList();
private boolean proxyMapReply;
private boolean wantMapNotify;
......@@ -199,12 +192,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
}
@Override
public RegisterBuilder withRecordCount(byte recordCount) {
this.recordCount = recordCount;
return this;
}
@Override
public RegisterBuilder withNonce(long nonce) {
this.nonce = nonce;
return this;
......@@ -241,7 +228,7 @@ public final class DefaultLispMapRegister implements LispMapRegister {
@Override
public LispMapRegister build() {
return new DefaultLispMapRegister(nonce, keyId, authDataLength,
authenticationData, recordCount, mapRecords, proxyMapReply, wantMapNotify);
authenticationData, mapRecords, proxyMapReply, wantMapNotify);
}
}
......@@ -296,7 +283,6 @@ public final class DefaultLispMapRegister implements LispMapRegister {
return new DefaultRegisterBuilder()
.withIsProxyMapReply(proxyMapReplyFlag)
.withIsWantMapNotify(wantMapNotifyFlag)
.withRecordCount(recordCount)
.withNonce(nonce)
.withKeyId(keyId)
.withAuthenticationData(authData)
......@@ -346,7 +332,7 @@ public final class DefaultLispMapRegister implements LispMapRegister {
byteBuf.writeByte(wantMapNotify);
// record count
byteBuf.writeByte(message.getRecordCount());
byteBuf.writeByte(message.getMapRecords().size());
// nonce
byteBuf.writeLong(message.getNonce());
......
......@@ -35,7 +35,6 @@ import static org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.MapRecordW
public final class DefaultLispMapReply implements LispMapReply {
private final long nonce;
private final byte recordCount;
private final boolean probe;
private final boolean etr;
private final boolean security;
......@@ -45,15 +44,13 @@ public final class DefaultLispMapReply implements LispMapReply {
* A private constructor that protects object instantiation from external.
*
* @param nonce nonce
* @param recordCount record count number
* @param probe probe flag
* @param etr etr flag
* @param security security flag
*/
private DefaultLispMapReply(long nonce, byte recordCount, boolean probe,
boolean etr, boolean security, List<LispMapRecord> mapRecords) {
private DefaultLispMapReply(long nonce, boolean probe, boolean etr,
boolean security, List<LispMapRecord> mapRecords) {
this.nonce = nonce;
this.recordCount = recordCount;
this.probe = probe;
this.etr = etr;
this.security = security;
......@@ -91,8 +88,8 @@ public final class DefaultLispMapReply implements LispMapReply {
}
@Override
public byte getRecordCount() {
return recordCount;
public int getRecordCount() {
return mapRecords.size();
}
@Override
......@@ -110,7 +107,6 @@ public final class DefaultLispMapReply implements LispMapReply {
return toStringHelper(this)
.add("type", getType())
.add("nonce", nonce)
.add("recordCount", recordCount)
.add("probe", probe)
.add("etr", etr)
.add("security", security)
......@@ -127,7 +123,6 @@ public final class DefaultLispMapReply implements LispMapReply {
}
DefaultLispMapReply that = (DefaultLispMapReply) o;
return Objects.equal(nonce, that.nonce) &&
Objects.equal(recordCount, that.recordCount) &&
Objects.equal(probe, that.probe) &&
Objects.equal(etr, that.etr) &&
Objects.equal(security, that.security) &&
......@@ -136,13 +131,12 @@ public final class DefaultLispMapReply implements LispMapReply {
@Override
public int hashCode() {
return Objects.hashCode(nonce, recordCount, probe, etr, security, mapRecords);
return Objects.hashCode(nonce, probe, etr, security, mapRecords);
}
public static final class DefaultReplyBuilder implements ReplyBuilder {
private long nonce;
private byte recordCount;
private boolean probe;
private boolean etr;
private boolean security;
......@@ -172,12 +166,6 @@ public final class DefaultLispMapReply implements LispMapReply {
}
@Override
public ReplyBuilder withRecordCount(byte recordCount) {
this.recordCount = recordCount;
return this;
}
@Override
public ReplyBuilder withNonce(long nonce) {
this.nonce = nonce;
return this;
......@@ -193,7 +181,7 @@ public final class DefaultLispMapReply implements LispMapReply {
@Override
public LispMapReply build() {
return new DefaultLispMapReply(nonce, recordCount, probe, etr, security, mapRecords);
return new DefaultLispMapReply(nonce, probe, etr, security, mapRecords);
}
}
......@@ -243,7 +231,6 @@ public final class DefaultLispMapReply implements LispMapReply {
.withIsProbe(probe)
.withIsEtr(etr)
.withIsSecurity(security)
.withRecordCount(recordCount)
.withNonce(nonce)
.build();
}
......@@ -296,7 +283,7 @@ public final class DefaultLispMapReply implements LispMapReply {
byteBuf.writeShort((short) UNUSED_ZERO);
// record count
byteBuf.writeByte(message.getRecordCount());
byteBuf.writeByte(message.getMapRecords().size());
// nonce
byteBuf.writeLong(message.getNonce());
......
......@@ -39,7 +39,6 @@ import static org.onosproject.lisp.msg.protocols.LispEidRecord.EidRecordWriter;
public final class DefaultLispMapRequest implements LispMapRequest {
private final long nonce;
private final byte recordCount;
private final LispAfiAddress sourceEid;
private final List<LispAfiAddress> itrRlocs;
private final List<LispEidRecord> eidRecords;
......@@ -54,7 +53,6 @@ public final class DefaultLispMapRequest implements LispMapRequest {
* A private constructor that protects object instantiation from external.
*
* @param nonce nonce
* @param recordCount record count number
* @param sourceEid source EID address
* @param itrRlocs a collection of ITR RLOCs
* @param eidRecords a collection of EID records
......@@ -65,12 +63,11 @@ public final class DefaultLispMapRequest implements LispMapRequest {
* @param pitr pitr flag
* @param smrInvoked smrInvoked flag
*/
private DefaultLispMapRequest(long nonce, byte recordCount, LispAfiAddress sourceEid,
private DefaultLispMapRequest(long nonce, LispAfiAddress sourceEid,
List<LispAfiAddress> itrRlocs, List<LispEidRecord> eidRecords,
boolean authoritative, boolean mapDataPresent, boolean probe,
boolean smr, boolean pitr, boolean smrInvoked) {
this.nonce = nonce;
this.recordCount = recordCount;
this.sourceEid = sourceEid;
this.itrRlocs = itrRlocs;
this.eidRecords = eidRecords;
......@@ -128,8 +125,8 @@ public final class DefaultLispMapRequest implements LispMapRequest {
}
@Override
public byte getRecordCount() {
return recordCount;
public int getRecordCount() {
return eidRecords.size();
}
@Override
......@@ -157,7 +154,6 @@ public final class DefaultLispMapRequest implements LispMapRequest {
return toStringHelper(this)
.add("type", getType())
.add("nonce", nonce)
.add("recordCount", recordCount)
.add("source EID", sourceEid)
.add("ITR rlocs", itrRlocs)
.add("EID records", eidRecords)
......@@ -179,7 +175,6 @@ public final class DefaultLispMapRequest implements LispMapRequest {
}
DefaultLispMapRequest that = (DefaultLispMapRequest) o;
return Objects.equal(nonce, that.nonce) &&
Objects.equal(recordCount, that.recordCount) &&
Objects.equal(sourceEid, that.sourceEid) &&
Objects.equal(authoritative, that.authoritative) &&
Objects.equal(mapDataPresent, that.mapDataPresent) &&
......@@ -191,14 +186,13 @@ public final class DefaultLispMapRequest implements LispMapRequest {
@Override
public int hashCode() {
return Objects.hashCode(nonce, recordCount, sourceEid, authoritative,
return Objects.hashCode(nonce, sourceEid, authoritative,
mapDataPresent, probe, smr, pitr, smrInvoked);
}
public static final class DefaultRequestBuilder implements RequestBuilder {
private long nonce;
private byte recordCount;
private LispAfiAddress sourceEid;
private List<LispAfiAddress> itrRlocs = Lists.newArrayList();
private List<LispEidRecord> eidRecords = Lists.newArrayList();
......@@ -251,12 +245,6 @@ public final class DefaultLispMapRequest implements LispMapRequest {
}
@Override
public RequestBuilder withRecordCount(byte recordCount) {
this.recordCount = recordCount;
return this;
}
@Override
public RequestBuilder withNonce(long nonce) {
this.nonce = nonce;
return this;
......@@ -290,8 +278,8 @@ public final class DefaultLispMapRequest implements LispMapRequest {
checkNotNull(sourceEid, "Must have a source EID");
checkArgument((itrRlocs != null) && (itrRlocs.size() > 0), "Must have an ITR RLOC entry");
return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs,
eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked);
return new DefaultLispMapRequest(nonce, sourceEid, itrRlocs, eidRecords,
authoritative, mapDataPresent, probe, smr, pitr, smrInvoked);
}
}
......@@ -369,7 +357,6 @@ public final class DefaultLispMapRequest implements LispMapRequest {
.withIsPitr(pitr)
.withIsSmrInvoked(smrInvoked)
.withNonce(nonce)
.withRecordCount((byte) recordCount)
.withSourceEid(sourceEid)
.withEidRecords(eidRecords)
.withItrRlocs(itrRlocs)
......@@ -445,7 +432,7 @@ public final class DefaultLispMapRequest implements LispMapRequest {
byteBuf.writeByte((byte) message.getItrRlocs().size());
// record count
byteBuf.writeByte(message.getRecordCount());
byteBuf.writeByte(message.getEids().size());
// nonce
byteBuf.writeLong(message.getNonce());
......
......@@ -68,7 +68,7 @@ public interface LispMapNotify extends LispMessage {
*
* @return record count value
*/
byte getRecordCount();
int getRecordCount();
/**
* Obtains key identifier.
......@@ -112,14 +112,6 @@ public interface LispMapNotify extends LispMessage {
NotifyBuilder withNonce(long nonce);
/**
* Sets record count.
*
* @param recordCount record count
* @return NotifyBuilder object
*/
NotifyBuilder withRecordCount(byte recordCount);
/**
* Sets key identitifer.
*
* @param keyId key identifier
......
......@@ -102,14 +102,6 @@ public interface LispMapRecord {
MapRecordBuilder withRecordTtl(int recordTtl);
/**
* Sets locator count.
*
* @param locatorCount locator count
* @return MapRecordBuilder object
*/
MapRecordBuilder withLocatorCount(int locatorCount);
/**
* Sets mask length.
*
* @param maskLength mask length
......
......@@ -75,7 +75,7 @@ public interface LispMapRegister extends LispMessage {
*
* @return record count value
*/
byte getRecordCount();
int getRecordCount();
/**
* Obtains nonce value.
......@@ -134,14 +134,6 @@ public interface LispMapRegister extends LispMessage {
RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify);
/**
* Sets record count.
*
* @param recordCount record count
* @return RegisterBuilder object
*/
RegisterBuilder withRecordCount(byte recordCount);
/**
* Sets nonce value.
*
* @param nonce nonce value
......
......@@ -78,7 +78,7 @@ public interface LispMapReply extends LispMessage {
*
* @return record count value
*/
byte getRecordCount();
int getRecordCount();
/**
* Obtains nonce value.
......@@ -124,14 +124,6 @@ public interface LispMapReply extends LispMessage {
ReplyBuilder withIsSecurity(boolean security);
/**
* Sets record count.
*
* @param recordCount record count
* @return ReplyBuilder object
*/
ReplyBuilder withRecordCount(byte recordCount);
/**
* Sets nonce value.
*
* @param nonce nonce value
......
......@@ -102,7 +102,7 @@ public interface LispMapRequest extends LispMessage {
*
* @return record count value
*/
byte getRecordCount();
int getRecordCount();
/**
* Obtains nonce value.
......@@ -186,14 +186,6 @@ public interface LispMapRequest extends LispMessage {
RequestBuilder withIsSmrInvoked(boolean smrInvoked);
/**
* Sets record count.
*
* @param recordCount record count
* @return RequestBuilder object
*/
RequestBuilder withRecordCount(byte recordCount);
/**
* Sets nonce value.
*
* @param nonce nonce value
......
......@@ -46,7 +46,6 @@ public final class DefaultLispMapNotifyTest {
notify1 = builder1
.withKeyId((short) 1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapNotify.NotifyBuilder builder2 =
......@@ -55,7 +54,6 @@ public final class DefaultLispMapNotifyTest {
sameAsNotify1 = builder2
.withKeyId((short) 1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapNotify.NotifyBuilder builder3 =
......@@ -64,7 +62,6 @@ public final class DefaultLispMapNotifyTest {
notify2 = builder3
.withKeyId((short) 2)
.withNonce(2L)
.withRecordCount((byte) 0x02)
.build();
}
......@@ -81,7 +78,6 @@ public final class DefaultLispMapNotifyTest {
assertThat(notify.getKeyId(), is((short) 1));
assertThat(notify.getNonce(), is(1L));
assertThat(notify.getRecordCount(), is((byte) 0));
}
@Test
......
......@@ -50,7 +50,6 @@ public final class DefaultLispMapRecordTest {
record1 = builder1
.withRecordTtl(100)
.withAuthoritative(true)
.withLocatorCount(0)
.withMapVersionNumber((short) 1)
.withMaskLength((byte) 0x01)
.withAction(LispMapReplyAction.NativelyForward)
......@@ -63,7 +62,6 @@ public final class DefaultLispMapRecordTest {
sameAsRecord1 = builder2
.withRecordTtl(100)
.withAuthoritative(true)
.withLocatorCount(0)
.withMapVersionNumber((short) 1)
.withMaskLength((byte) 0x01)
.withAction(LispMapReplyAction.NativelyForward)
......@@ -78,7 +76,6 @@ public final class DefaultLispMapRecordTest {
record2 = builder3
.withRecordTtl(200)
.withAuthoritative(false)
.withLocatorCount(200)
.withMapVersionNumber((short) 2)
.withMaskLength((byte) 0x02)
.withAction(LispMapReplyAction.Drop)
......@@ -101,7 +98,6 @@ public final class DefaultLispMapRecordTest {
assertThat(record.getRecordTtl(), is(100));
assertThat(record.isAuthoritative(), is(true));
assertThat(record.getLocatorCount(), is(0));
assertThat(record.getMapVersionNumber(), is((short) 1));
assertThat(record.getMaskLength(), is((byte) 0x01));
assertThat(record.getAction(), is(LispMapReplyAction.NativelyForward));
......
......@@ -49,7 +49,6 @@ public final class DefaultLispMapRegisterTest {
.withIsWantMapNotify(false)
.withKeyId((short) 1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapRegister.RegisterBuilder builder2 =
......@@ -60,7 +59,6 @@ public final class DefaultLispMapRegisterTest {
.withIsWantMapNotify(false)
.withKeyId((short) 1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapRegister.RegisterBuilder builder3 =
......@@ -71,7 +69,6 @@ public final class DefaultLispMapRegisterTest {
.withIsWantMapNotify(false)
.withKeyId((short) 2)
.withNonce(2L)
.withRecordCount((byte) 0x02)
.build();
}
......@@ -90,7 +87,6 @@ public final class DefaultLispMapRegisterTest {
assertThat(register.isWantMapNotify(), is(false));
assertThat(register.getKeyId(), is((short) 1));
assertThat(register.getNonce(), is(1L));
assertThat(register.getRecordCount(), is((byte) 0));
}
@Test
......
......@@ -49,7 +49,6 @@ public final class DefaultLispMapReplyTest {
.withIsProbe(false)
.withIsSecurity(true)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapReply.ReplyBuilder builder2 =
......@@ -60,7 +59,6 @@ public final class DefaultLispMapReplyTest {
.withIsProbe(false)
.withIsSecurity(true)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
LispMapReply.ReplyBuilder builder3 =
......@@ -70,7 +68,6 @@ public final class DefaultLispMapReplyTest {
.withIsProbe(true)
.withIsSecurity(false)
.withNonce(2L)
.withRecordCount((byte) 0x02)
.build();
}
......@@ -89,7 +86,6 @@ public final class DefaultLispMapReplyTest {
assertThat(reply.isProbe(), is(false));
assertThat(reply.isSecurity(), is(true));
assertThat(reply.getNonce(), is(1L));
assertThat(reply.getRecordCount(), is((byte) 0));
}
@Test
......
......@@ -65,7 +65,6 @@ public final class DefaultLispMapRequestTest {
.withSourceEid(ipv4Eid1)
.withItrRlocs(rlocs1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
RequestBuilder builder2 = new DefaultRequestBuilder();
......@@ -80,7 +79,6 @@ public final class DefaultLispMapRequestTest {
.withSourceEid(ipv4Eid1)
.withItrRlocs(rlocs1)
.withNonce(1L)
.withRecordCount((byte) 0)
.build();
RequestBuilder builder3 = new DefaultRequestBuilder();
......@@ -102,7 +100,6 @@ public final class DefaultLispMapRequestTest {
.withSourceEid(ipv4Eid2)
.withItrRlocs(rlocs2)
.withNonce(2L)
.withRecordCount((byte) 0x02)
.build();
}
......@@ -124,7 +121,6 @@ public final class DefaultLispMapRequestTest {
assertThat(request.isSmr(), is(true));
assertThat(request.isSmrInvoked(), is(false));
assertThat(request.getNonce(), is(1L));
assertThat(request.getRecordCount(), is((byte) 0));
}
@Test
......