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.217.1 test/tracing/span_context_test.rb
instana-1.217.0 test/tracing/span_context_test.rb
instana-1.216.0 test/tracing/span_context_test.rb
instana-1.215.1 test/tracing/span_context_test.rb
instana-1.215.0 test/tracing/span_context_test.rb
instana-1.214.4 test/tracing/span_context_test.rb
instana-1.214.3 test/tracing/span_context_test.rb
instana-1.214.2 test/tracing/span_context_test.rb
instana-1.214.1 test/tracing/span_context_test.rb
instana-1.214.0 test/tracing/span_context_test.rb
instana-1.213.3 test/tracing/span_context_test.rb
instana-1.213.2 test/tracing/span_context_test.rb
instana-1.213.1 test/tracing/span_context_test.rb
instana-1.213.0 test/tracing/span_context_test.rb
instana-1.212.0 test/tracing/span_context_test.rb
instana-1.211.0 test/tracing/span_context_test.rb
instana-1.210.1 test/tracing/span_context_test.rb
instana-1.210.0 test/tracing/span_context_test.rb
instana-1.209.8 test/tracing/span_context_test.rb
instana-1.209.7 test/tracing/span_context_test.rb