'c',
'd' // cookie syncCookie OPTIONAL,
} );
bb.flip();
SyncStateValue decorator = new SyncStateValueDecorator( codec );
SyncStateValue syncStateValue = ( SyncStateValue ) ( ( SyncStateValueDecorator ) decorator )
.decode( bb.array() );
assertEquals( SyncStateTypeEnum.PRESENT, syncStateValue.getSyncStateType() );
assertEquals( "abc", Strings.utf8ToString( syncStateValue.getEntryUUID() ) );
assertEquals( "xkcd", Strings.utf8ToString( syncStateValue.getCookie() ) );
// Check the encoding
try
{
ByteBuffer encoded = ( ( SyncStateValueDecorator ) syncStateValue ).encode( ByteBuffer