catch ( DecoderException de )
{
fail( de.getMessage() );
}
LastReq lastReq = lastReqContainer.getLastReq();
assertNotNull( lastReq.getLastReqs().size() );
assertEquals( 2, lastReq.getLastReqs().size() );
String[] expected = new String[]
{ "20101110154525Z", "20101110154526Z" };
int i = 0;
for ( LastReqEntry lre : lastReq.getLastReqs() )
{
assertEquals( LastReqType.TIME_OF_INITIAL_REQ, lre.getLrType() );
assertEquals( expected[i++], lre.getLrValue().toString() );
}
// Check the encoding
ByteBuffer bb = ByteBuffer.allocate( lastReq.computeLength() );
try
{
bb = lastReq.encode( bb );
// Check the length
assertEquals( 0x36, bb.limit() );
String encodedPdu = Strings.dumpBytes( bb.array() );