Sha256: a83535ba9c3cddadae3fe077b571f6afe63730296f217e4a031f25c770410f50

Contents?: true

Size: 668 Bytes

Versions: 54

Compression:

Stored size: 668 Bytes

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021

require 'test_helper'

class SpanContextTest < Minitest::Test
  def test_to_hash
    subject = Instana::SpanContext.new('trace', 'span')
    assert_equal({trace_id: 'trace', span_id: 'span'}, subject.to_hash)
  end

  def test_invalid
    subject = Instana::SpanContext.new(nil, nil)
    refute subject.valid?
  end

  def test_flags_level_zero
    subject = Instana::SpanContext.new('trace', 'span', 0, {external_state: 'cn=test'})
    assert_equal '00-000000000000000000000000000trace-000000000000span-00', subject.trace_parent_header
    assert_equal 'cn=test', subject.trace_state_header
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
instana-1.209.6 test/tracing/span_context_test.rb
instana-1.209.5 test/tracing/span_context_test.rb
instana-1.209.4 test/tracing/span_context_test.rb
instana-1.209.3 test/tracing/span_context_test.rb
instana-1.209.2 test/tracing/span_context_test.rb
instana-1.209.1 test/tracing/span_context_test.rb
instana-1.209.0.pre3 test/tracing/span_context_test.rb
instana-1.209.0.pre2 test/tracing/span_context_test.rb
instana-1.209.0.pre1 test/tracing/span_context_test.rb
instana-1.208.0 test/tracing/span_context_test.rb
instana-1.207.0 test/tracing/span_context_test.rb
instana-1.206.0 test/tracing/span_context_test.rb
instana-1.205.0 test/tracing/span_context_test.rb
instana-1.204.0 test/tracing/span_context_test.rb
instana-1.204.0.pre3 test/tracing/span_context_test.rb
instana-1.204.0.pre2 test/tracing/span_context_test.rb
instana-1.204.0.pre1 test/tracing/span_context_test.rb
instana-1.203.2 test/tracing/span_context_test.rb
instana-1.203.1 test/tracing/span_context_test.rb
instana-1.203.0 test/tracing/span_context_test.rb