diff --git a/lib/datadog/core/remote/transport/http/client.rb b/lib/datadog/core/remote/transport/http/client.rb index 2a4c51d2e05..39d130d2295 100644 --- a/lib/datadog/core/remote/transport/http/client.rb +++ b/lib/datadog/core/remote/transport/http/client.rb @@ -38,7 +38,7 @@ def send_request(request, &block) end def build_env(request) - Datadog::Tracing::Transport::HTTP::Env.new(request) + Datadog::Core::Transport::HTTP::Env.new(request) end end end diff --git a/lib/datadog/core/transport/http/env.rb b/lib/datadog/core/transport/http/env.rb index 28e13354ae9..592fc9a842a 100644 --- a/lib/datadog/core/transport/http/env.rb +++ b/lib/datadog/core/transport/http/env.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Datadog - module Tracing + module Core module Transport module HTTP # Data structure for an HTTP request diff --git a/lib/datadog/tracing/transport/http/client.rb b/lib/datadog/tracing/transport/http/client.rb index def2386c17f..e19491ddabc 100644 --- a/lib/datadog/tracing/transport/http/client.rb +++ b/lib/datadog/tracing/transport/http/client.rb @@ -48,7 +48,7 @@ def send_request(request, &block) end def build_env(request) - Env.new(request) + Datadog::Core::Transport::HTTP::Env.new(request) end end end diff --git a/spec/datadog/core/transport/http/adapters/net_spec.rb b/spec/datadog/core/transport/http/adapters/net_spec.rb index 65841527da4..9dd64ae8b5f 100644 --- a/spec/datadog/core/transport/http/adapters/net_spec.rb +++ b/spec/datadog/core/transport/http/adapters/net_spec.rb @@ -33,7 +33,7 @@ shared_context 'HTTP Env' do let(:env) do instance_double( - Datadog::Tracing::Transport::HTTP::Env, + Datadog::Core::Transport::HTTP::Env, path: path, body: body, headers: headers, diff --git a/spec/datadog/core/transport/http/adapters/test_spec.rb b/spec/datadog/core/transport/http/adapters/test_spec.rb index 6ad6b4e9a53..a5bb1367910 100644 --- a/spec/datadog/core/transport/http/adapters/test_spec.rb +++ b/spec/datadog/core/transport/http/adapters/test_spec.rb @@ -33,7 +33,7 @@ describe '#call' do subject(:call) { adapter.call(env) } - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env) } it 'returns a response with correct attributes' do is_expected.to be_a_kind_of(described_class::Response) @@ -85,7 +85,7 @@ describe '#add_request' do subject(:call) { adapter.add_request(env) } - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env) } context 'when buffer' do context 'is not active' do diff --git a/spec/datadog/core/transport/http/api/endpoint_spec.rb b/spec/datadog/core/transport/http/api/endpoint_spec.rb index eb7c0945396..bf40841b3dd 100644 --- a/spec/datadog/core/transport/http/api/endpoint_spec.rb +++ b/spec/datadog/core/transport/http/api/endpoint_spec.rb @@ -19,7 +19,7 @@ end describe '#call' do - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env) } before do expect(env).to receive(:verb=).with(verb) diff --git a/spec/datadog/tracing/transport/http/env_spec.rb b/spec/datadog/core/transport/http/env_spec.rb similarity index 94% rename from spec/datadog/tracing/transport/http/env_spec.rb rename to spec/datadog/core/transport/http/env_spec.rb index 8da2acf7faf..ac5cd5863cc 100644 --- a/spec/datadog/tracing/transport/http/env_spec.rb +++ b/spec/datadog/core/transport/http/env_spec.rb @@ -3,7 +3,7 @@ require 'datadog/core/transport/http/env' require 'datadog/core/transport/request' -RSpec.describe Datadog::Tracing::Transport::HTTP::Env do +RSpec.describe Datadog::Core::Transport::HTTP::Env do subject(:env) { described_class.new(request, options) } let(:request) { instance_double(Datadog::Core::Transport::Request) } diff --git a/spec/datadog/tracing/transport/http/api/instance_spec.rb b/spec/datadog/tracing/transport/http/api/instance_spec.rb index d3ecea17f8f..1add3e7e327 100644 --- a/spec/datadog/tracing/transport/http/api/instance_spec.rb +++ b/spec/datadog/tracing/transport/http/api/instance_spec.rb @@ -28,7 +28,7 @@ end describe '#call' do - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env, headers: env_headers) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env, headers: env_headers) } let(:env_headers) { {} } before { instance.call(env) } diff --git a/spec/datadog/tracing/transport/http/client_spec.rb b/spec/datadog/tracing/transport/http/client_spec.rb index accdcc1ffed..69decdcad23 100644 --- a/spec/datadog/tracing/transport/http/client_spec.rb +++ b/spec/datadog/tracing/transport/http/client_spec.rb @@ -51,7 +51,7 @@ it 'sends to only the current API once' do is_expected.to eq(response) expect(handler).to have_received(:api).with(api).once - expect(handler).to have_received(:env).with(kind_of(Datadog::Tracing::Transport::HTTP::Env)).once + expect(handler).to have_received(:env).with(kind_of(Datadog::Core::Transport::HTTP::Env)).once end end @@ -115,8 +115,8 @@ let(:request) { instance_double(Datadog::Core::Transport::Request) } - it 'returns a Datadog::Tracing::Transport::HTTP::Env' do - is_expected.to be_a_kind_of(Datadog::Tracing::Transport::HTTP::Env) + it 'returns a Datadog::Core::Transport::HTTP::Env' do + is_expected.to be_a_kind_of(Datadog::Core::Transport::HTTP::Env) expect(env.request).to be request end end diff --git a/spec/datadog/tracing/transport/http/traces_spec.rb b/spec/datadog/tracing/transport/http/traces_spec.rb index 118c3d10590..5053cdd7223 100644 --- a/spec/datadog/tracing/transport/http/traces_spec.rb +++ b/spec/datadog/tracing/transport/http/traces_spec.rb @@ -39,7 +39,7 @@ .with(response) expect(api).to receive(:send_traces) do |env| - expect(env).to be_a_kind_of(Datadog::Tracing::Transport::HTTP::Env) + expect(env).to be_a_kind_of(Datadog::Core::Transport::HTTP::Env) expect(env.request).to be(request) response end @@ -63,7 +63,7 @@ describe '#send_traces' do subject(:send_traces) { spec.send_traces(env, &block) } - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env) } let(:block) { proc {} } context 'when a trace endpoint has not been defined' do @@ -107,7 +107,7 @@ describe '#send_traces' do subject(:send_traces) { instance.send_traces(env) } - let(:env) { instance_double(Datadog::Tracing::Transport::HTTP::Env) } + let(:env) { instance_double(Datadog::Core::Transport::HTTP::Env) } context 'when specification does not support traces' do let(:spec) { double('spec') } @@ -164,7 +164,7 @@ describe '#call' do subject(:call) { endpoint.call(env, &block) } - let(:env) { Datadog::Tracing::Transport::HTTP::Env.new(request) } + let(:env) { Datadog::Core::Transport::HTTP::Env.new(request) } let(:request) { Datadog::Tracing::Transport::Traces::Request.new(parcel) } let(:parcel) { double(Datadog::Tracing::Transport::Traces::EncodedParcel, data: data, trace_count: trace_count) } let(:data) { double('trace_once') }