test/instrumentation/net_http_test.rb in instana-1.195.1 vs test/instrumentation/net_http_test.rb in instana-1.195.2
- old
+ new
@@ -9,9 +9,27 @@
assert ::Instana.config[:nethttp].is_a?(Hash)
assert ::Instana.config[:nethttp].key?(:enabled)
assert_equal true, ::Instana.config[:nethttp][:enabled]
end
+ def test_get_with_query
+ clear_all!
+ WebMock.allow_net_connect!
+
+ Instana.tracer.start_or_continue_trace(:"net-http-test") do
+ Net::HTTP.get(URI('http://127.0.0.1:6511/?query_value=true'))
+ end
+
+ spans = ::Instana.processor.queued_spans
+ assert_equal 3, spans.length
+
+ http_span = find_first_span_by_name(spans, :'net-http')
+ assert_equal "http://127.0.0.1:6511/", http_span[:data][:http][:url]
+ assert_equal "query_value=true", http_span[:data][:http][:params]
+
+ WebMock.disable_net_connect!
+ end
+
def test_block_request
clear_all!
WebMock.allow_net_connect!
url = "http://127.0.0.1:6511/"