Sha256: 176d4242d1af27460b1803fd546ea5515eae8871e210a147a06b8eebd73d9012

Contents?: true

Size: 812 Bytes

Versions: 1

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper.rb'

describe 'RFlow::Message::Data::AMQP::Message Avro Schema' do
  let(:schema) { RFlow::Configuration.available_data_types['RFlow::Message::Data::AMQP::Message']['avro'] }

  it "should encode and decode an object" do
    message = {
      'header'  => {
        'content_type'  => 'application/octet-stream',
        'delivery_mode' => 2,
        'priority'      => 0,
      },
      'payload' =>'PAYLOAD',
    }

    expect { encode_avro(schema, message)}.to_not raise_error
    encoded_message = encode_avro(schema, message)

    expect { decode_avro(schema, encoded_message) }.to_not raise_error
    decoded_message = decode_avro(schema, encoded_message)

    decoded_message['payload'].should == message['payload']
    decoded_message['header'].should == message['header']
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rflow-components-amqp-1.0.0a2 spec/schema_spec.rb