SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
SyncInfoValue syncInfoValue = (SyncInfoValue)decorator.decode( bb.array() );
assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
assertFalse( syncInfoValue.isRefreshDone() );
// Check the encoding
try
{
ByteBuffer encoded = ((SyncInfoValueDecorator)syncInfoValue).encode( ByteBuffer.allocate( ((SyncInfoValueDecorator)syncInfoValue).computeLength() ) );