@@ -169,36 +169,26 @@ void normal() {
169169
170170 AttributesBuilder startAttributes = Attributes .builder ();
171171 extractor .onStart (startAttributes , Context .root (), request );
172- // assertThat(startAttributes.build())
173- // .containsOnly(
174- // entry(HttpAttributes.HTTP_REQUEST_METHOD, "POST"),
175- // entry(UrlAttributes.URL_FULL, "http://github.com"),
176- // entry(
177- // AttributeKey.stringArrayKey("http.request.header.custom-request-header"),
178- // asList("123", "456")),
179- // entry(ServerAttributes.SERVER_ADDRESS, "github.com"),
180- // entry(ServerAttributes.SERVER_PORT, 80L),
181- // entry(HttpAttributes.HTTP_REQUEST_RESEND_COUNT, 2L));
182172
183173 AttributesBuilder endAttributes = Attributes .builder ();
184174 extractor .onEnd (endAttributes , Context .root (), request , response , null );
185175 assertThat (endAttributes .build ())
186- .containsOnly (
187- entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 202L ),
188- entry (
189- AttributeKey .stringArrayKey ("http.response.header.custom-response-header" ),
190- asList ("654" , "321" )),
191- entry (NetworkAttributes .NETWORK_PROTOCOL_VERSION , "1.1" ),
192- entry (NetworkAttributes .NETWORK_PEER_ADDRESS , "4.3.2.1" ),
193- entry (HttpAttributes .HTTP_REQUEST_METHOD , "POST" ),
194- entry (UrlAttributes .URL_FULL , "http://github.com" ),
195- entry (
196- AttributeKey .stringArrayKey ("http.request.header.custom-request-header" ),
197- asList ("123" , "456" )),
198- entry (ServerAttributes .SERVER_ADDRESS , "github.com" ),
199- entry (ServerAttributes .SERVER_PORT , 80L ),
200- entry (HttpAttributes .HTTP_REQUEST_RESEND_COUNT , 2L ),
201- entry (NetworkAttributes .NETWORK_PEER_PORT , 456L ));
176+ .containsOnly (
177+ entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 202L ),
178+ entry (
179+ AttributeKey .stringArrayKey ("http.response.header.custom-response-header" ),
180+ asList ("654" , "321" )),
181+ entry (NetworkAttributes .NETWORK_PROTOCOL_VERSION , "1.1" ),
182+ entry (NetworkAttributes .NETWORK_PEER_ADDRESS , "4.3.2.1" ),
183+ entry (HttpAttributes .HTTP_REQUEST_METHOD , "POST" ),
184+ entry (UrlAttributes .URL_FULL , "http://github.com" ),
185+ entry (
186+ AttributeKey .stringArrayKey ("http.request.header.custom-request-header" ),
187+ asList ("123" , "456" )),
188+ entry (ServerAttributes .SERVER_ADDRESS , "github.com" ),
189+ entry (ServerAttributes .SERVER_PORT , 80L ),
190+ entry (HttpAttributes .HTTP_REQUEST_RESEND_COUNT , 2L ),
191+ entry (NetworkAttributes .NETWORK_PEER_PORT , 456L ));
202192 }
203193
204194 @ ParameterizedTest
@@ -362,21 +352,17 @@ void shouldExtractServerAddressAndPortFromHostHeader() {
362352 response .put ("statusCode" , "200" );
363353
364354 AttributesExtractor <Map <String , String >, Map <String , String >> extractor =
365- HttpClientAttributesExtractor .create (new TestHttpClientAttributesGetter ());
355+ HttpClientAttributesExtractor .create (new TestHttpClientAttributesGetter ());
366356
367357 AttributesBuilder startAttributes = Attributes .builder ();
368358 extractor .onStart (startAttributes , Context .root (), request );
369- // assertThat(startAttributes.build())
370- // .containsOnly(
371- // entry(ServerAttributes.SERVER_ADDRESS, "github.com"),
372- // entry(ServerAttributes.SERVER_PORT, 123L));
373359
374360 AttributesBuilder endAttributes = Attributes .builder ();
375361 extractor .onEnd (endAttributes , Context .root (), request , response , null );
376362 assertThat (endAttributes .build ())
377- .containsOnly (entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 200L ),
378- entry (ServerAttributes .SERVER_ADDRESS , "github.com" ),
379- entry (ServerAttributes .SERVER_PORT , 123L ));
363+ .containsOnly (entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 200L ),
364+ entry (ServerAttributes .SERVER_ADDRESS , "github.com" ),
365+ entry (ServerAttributes .SERVER_PORT , 123L ));
380366 }
381367
382368 @ Test
@@ -391,24 +377,20 @@ void shouldExtractPeerAddressEvenIfItDuplicatesServerAddress() {
391377 response .put ("statusCode" , "200" );
392378
393379 AttributesExtractor <Map <String , String >, Map <String , String >> extractor =
394- HttpClientAttributesExtractor .create (new TestHttpClientAttributesGetter ());
380+ HttpClientAttributesExtractor .create (new TestHttpClientAttributesGetter ());
395381
396382 AttributesBuilder startAttributes = Attributes .builder ();
397383 extractor .onStart (startAttributes , Context .root (), request );
398- // assertThat(startAttributes.build())
399- // .containsOnly(
400- // entry(ServerAttributes.SERVER_ADDRESS, "1.2.3.4"),
401- // entry(ServerAttributes.SERVER_PORT, 123L));
402384
403385 AttributesBuilder endAttributes = Attributes .builder ();
404386 extractor .onEnd (endAttributes , Context .root (), request , response , null );
405387 assertThat (endAttributes .build ())
406- .containsOnly (
407- entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 200L ),
408- entry (NetworkAttributes .NETWORK_PEER_ADDRESS , "1.2.3.4" ),
409- entry (NetworkAttributes .NETWORK_PEER_PORT , 456L ),
410- entry (ServerAttributes .SERVER_ADDRESS , "1.2.3.4" ),
411- entry (ServerAttributes .SERVER_PORT , 123L ));
388+ .containsOnly (
389+ entry (HttpAttributes .HTTP_RESPONSE_STATUS_CODE , 200L ),
390+ entry (NetworkAttributes .NETWORK_PEER_ADDRESS , "1.2.3.4" ),
391+ entry (NetworkAttributes .NETWORK_PEER_PORT , 456L ),
392+ entry (ServerAttributes .SERVER_ADDRESS , "1.2.3.4" ),
393+ entry (ServerAttributes .SERVER_PORT , 123L ));
412394 }
413395
414396 @ Test
0 commit comments