Minor, modified access to fields of SubscribeMessage.Couple
This commit is contained in:
@@ -119,8 +119,8 @@ public class SubscribeDecoderTest {
|
||||
ByteBuf topicBuffer = Unpooled.buffer(4);
|
||||
topicBuffer.writeShort(messageID);
|
||||
for (SubscribeMessage.Couple couple : topics) {
|
||||
topicBuffer.writeBytes(Utils.encodeString(couple.getTopicFilter()));
|
||||
topicBuffer.writeByte(couple.getQos());
|
||||
topicBuffer.writeBytes(Utils.encodeString(couple.topicFilter));
|
||||
topicBuffer.writeByte(couple.qos);
|
||||
}
|
||||
|
||||
buff.clear().writeByte(AbstractMessage.SUBSCRIBE << 4 | (byte)0x02)
|
||||
@@ -131,8 +131,8 @@ public class SubscribeDecoderTest {
|
||||
private void initPollutedTopic(ByteBuf buff, int messageID, SubscribeMessage.Couple topic) throws IllegalAccessException {
|
||||
ByteBuf topicBuffer = Unpooled.buffer(4);
|
||||
topicBuffer.writeShort(messageID);
|
||||
topicBuffer.writeBytes(Utils.encodeString(topic.getTopicFilter()));
|
||||
topicBuffer.writeByte(0xF0 | topic.getQos());
|
||||
topicBuffer.writeBytes(Utils.encodeString(topic.topicFilter));
|
||||
topicBuffer.writeByte(0xF0 | topic.qos);
|
||||
|
||||
buff.clear().writeByte(AbstractMessage.SUBSCRIBE << 4 | (byte)0x02)
|
||||
.writeBytes(Utils.encodeRemainingLength(topicBuffer.readableBytes()));
|
||||
|
||||
@@ -64,10 +64,10 @@ public class SubscribeEncoderTest {
|
||||
assertEquals((byte)0xBB, m_out.readByte());
|
||||
|
||||
//Variable part
|
||||
TestUtils.verifyString(c1.getTopicFilter(), m_out);
|
||||
assertEquals(c1.getQos(), m_out.readByte());
|
||||
TestUtils.verifyString(c2.getTopicFilter(), m_out);
|
||||
assertEquals(c2.getQos(), m_out.readByte());
|
||||
TestUtils.verifyString(c1.topicFilter, m_out);
|
||||
assertEquals(c1.qos, m_out.readByte());
|
||||
TestUtils.verifyString(c2.topicFilter, m_out);
|
||||
assertEquals(c2.qos, m_out.readByte());
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
|
||||
Reference in New Issue
Block a user