@@ -77,10 +77,10 @@ void setup() {
77
77
void successfullyCompletedCommandShouldCreateSpanWhenParentSampleInRequestContext () {
78
78
79
79
// given
80
- TestRequestContext testRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
80
+ TraceRequestContext traceRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
81
81
82
82
// when
83
- commandStartedAndSucceeded (testRequestContext );
83
+ commandStartedAndSucceeded (traceRequestContext );
84
84
85
85
// then
86
86
assertThatMongoSpanIsClientWithTags ().hasIpThatIsBlank ().hasPortThatIsNotSet ();
@@ -91,10 +91,10 @@ void successfullyCompletedCommandShouldCreateSpanWithAddressInfoWhenParentSample
91
91
92
92
// given
93
93
handler .setSetRemoteIpAndPortEnabled (true );
94
- TestRequestContext testRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
94
+ TraceRequestContext traceRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
95
95
96
96
// when
97
- commandStartedAndSucceeded (testRequestContext );
97
+ commandStartedAndSucceeded (traceRequestContext );
98
98
99
99
// then
100
100
assertThatMongoSpanIsClientWithTags ().hasIpThatIsNotBlank ().hasPortThatIsSet ();
@@ -104,28 +104,28 @@ void successfullyCompletedCommandShouldCreateSpanWithAddressInfoWhenParentSample
104
104
void commandWithErrorShouldCreateTimerWhenParentSampleInRequestContext () {
105
105
106
106
// given
107
- TestRequestContext testRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
107
+ TraceRequestContext traceRequestContext = createTestRequestContextWithParentObservationAndStartIt ();
108
108
109
109
// when
110
- listener .commandStarted (new CommandStartedEvent (testRequestContext , 0 , //
110
+ listener .commandStarted (new CommandStartedEvent (traceRequestContext , 0 , //
111
111
new ConnectionDescription ( //
112
112
new ServerId ( //
113
113
new ClusterId ("description" ), //
114
114
new ServerAddress ("localhost" , 1234 ))), //
115
115
"database" , "insert" , //
116
116
new BsonDocument ("collection" , new BsonString ("user" ))));
117
117
listener .commandFailed ( //
118
- new CommandFailedEvent (testRequestContext , 0 , null , "insert" , 0 , new IllegalAccessException ()));
118
+ new CommandFailedEvent (traceRequestContext , 0 , null , "insert" , 0 , new IllegalAccessException ()));
119
119
120
120
// then
121
121
assertThatMongoSpanIsClientWithTags ().assertThatThrowable ().isInstanceOf (IllegalAccessException .class );
122
122
}
123
123
124
124
/**
125
- * Create a parent {@link Observation} then wrap it inside a {@link TestRequestContext }.
125
+ * Create a parent {@link Observation} then wrap it inside a {@link TraceRequestContext }.
126
126
*/
127
127
@ NotNull
128
- private TestRequestContext createTestRequestContextWithParentObservationAndStartIt () {
128
+ private TraceRequestContext createTestRequestContextWithParentObservationAndStartIt () {
129
129
130
130
Observation parent = Observation .start ("name" , observationRegistry );
131
131
return TestRequestContext .withObservation (parent );
@@ -134,21 +134,21 @@ private TestRequestContext createTestRequestContextWithParentObservationAndStart
134
134
/**
135
135
* Execute MongoDB's {@link com.mongodb.event.CommandListener#commandStarted(CommandStartedEvent)} and
136
136
* {@link com.mongodb.event.CommandListener#commandSucceeded(CommandSucceededEvent)} operations against the
137
- * {@link TestRequestContext } in order to inject some test data.
137
+ * {@link TraceRequestContext } in order to inject some test data.
138
138
*
139
- * @param testRequestContext
139
+ * @param traceRequestContext
140
140
*/
141
- private void commandStartedAndSucceeded (TestRequestContext testRequestContext ) {
141
+ private void commandStartedAndSucceeded (TraceRequestContext traceRequestContext ) {
142
142
143
- listener .commandStarted (new CommandStartedEvent (testRequestContext , 0 , //
143
+ listener .commandStarted (new CommandStartedEvent (traceRequestContext , 0 , //
144
144
new ConnectionDescription ( //
145
145
new ServerId ( //
146
146
new ClusterId ("description" ), //
147
147
new ServerAddress ("localhost" , 1234 ))), //
148
148
"database" , "insert" , //
149
149
new BsonDocument ("collection" , new BsonString ("user" ))));
150
150
151
- listener .commandSucceeded (new CommandSucceededEvent (testRequestContext , 0 , null , "insert" , null , 0 ));
151
+ listener .commandSucceeded (new CommandSucceededEvent (traceRequestContext , 0 , null , "insert" , null , 0 ));
152
152
}
153
153
154
154
/**
0 commit comments