| 
9 | 9 | import static io.opentelemetry.api.trace.SpanKind.CLIENT;  | 
10 | 10 | import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT;  | 
11 | 11 | import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;  | 
12 |  | -import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies;  | 
13 | 12 | import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;  | 
14 | 13 | import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;  | 
15 | 14 | import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;  | 
@@ -159,42 +158,25 @@ void testTimeoutAndRetryErrorsNotCaptured() {  | 
159 | 158 |         .waitAndAssertTraces(  | 
160 | 159 |             trace ->  | 
161 | 160 |                 trace.hasSpansSatisfyingExactly(  | 
162 |  | -                    span -> {  | 
163 |  | -                      span.hasName("S3.GetObject")  | 
164 |  | -                          .hasKind(CLIENT)  | 
165 |  | -                          .hasStatus(StatusData.error())  | 
166 |  | -                          .hasNoParent()  | 
167 |  | -                          .hasAttributesSatisfyingExactly(  | 
168 |  | -                              equalTo(URL_FULL, server.httpUri().toString()),  | 
169 |  | -                              equalTo(HTTP_REQUEST_METHOD, "GET"),  | 
170 |  | -                              equalTo(SERVER_PORT, server.httpPort()),  | 
171 |  | -                              equalTo(SERVER_ADDRESS, "127.0.0.1"),  | 
172 |  | -                              equalTo(RPC_SYSTEM, "aws-api"),  | 
173 |  | -                              equalTo(RPC_SERVICE, "Amazon S3"),  | 
174 |  | -                              equalTo(RPC_METHOD, "GetObject"),  | 
175 |  | -                              equalTo(stringKey("aws.endpoint"), server.httpUri().toString()),  | 
176 |  | -                              equalTo(stringKey("aws.agent"), "java-aws-sdk"),  | 
177 |  | -                              equalTo(stringKey("aws.bucket.name"), "someBucket"),  | 
178 |  | -                              satisfies(  | 
179 |  | -                                  ERROR_TYPE,  | 
180 |  | -                                  val ->  | 
181 |  | -                                      val.satisfiesAnyOf(  | 
182 |  | -                                          v ->  | 
183 |  | -                                              assertThat(v)  | 
184 |  | -                                                  .isEqualTo(SdkClientException.class.getName()),  | 
185 |  | -                                          v ->  | 
186 |  | -                                              assertThat(v)  | 
187 |  | -                                                  .isEqualTo(  | 
188 |  | -                                                      AmazonClientException.class.getName()))));  | 
189 |  | - | 
190 |  | -                      try {  | 
191 |  | -                        span.hasException(  | 
192 |  | -                            new AmazonClientException("Unable to execute HTTP request"));  | 
193 |  | -                      } catch (AssertionError e) {  | 
194 |  | -                        span.hasException(  | 
195 |  | -                            new SdkClientException(  | 
196 |  | -                                "Unable to execute HTTP request: Request did not complete before the request timeout configuration."));  | 
197 |  | -                      }  | 
198 |  | -                    }));  | 
 | 161 | +                    span ->  | 
 | 162 | +                        span.hasName("S3.GetObject")  | 
 | 163 | +                            .hasKind(CLIENT)  | 
 | 164 | +                            .hasStatus(StatusData.error())  | 
 | 165 | +                            .hasNoParent()  | 
 | 166 | +                            .hasException(  | 
 | 167 | +                                new SdkClientException(  | 
 | 168 | +                                    "Unable to execute HTTP request: Request did not complete before the request timeout configuration."))  | 
 | 169 | +                            .hasAttributesSatisfyingExactly(  | 
 | 170 | +                                equalTo(URL_FULL, server.httpUri().toString()),  | 
 | 171 | +                                equalTo(HTTP_REQUEST_METHOD, "GET"),  | 
 | 172 | +                                equalTo(SERVER_PORT, server.httpPort()),  | 
 | 173 | +                                equalTo(SERVER_ADDRESS, "127.0.0.1"),  | 
 | 174 | +                                equalTo(RPC_SYSTEM, "aws-api"),  | 
 | 175 | +                                equalTo(RPC_SERVICE, "Amazon S3"),  | 
 | 176 | +                                equalTo(RPC_METHOD, "GetObject"),  | 
 | 177 | +                                equalTo(stringKey("aws.endpoint"), server.httpUri().toString()),  | 
 | 178 | +                                equalTo(stringKey("aws.agent"), "java-aws-sdk"),  | 
 | 179 | +                                equalTo(stringKey("aws.bucket.name"), "someBucket"),  | 
 | 180 | +                                equalTo(ERROR_TYPE, SdkClientException.class.getName()))));  | 
199 | 181 |   }  | 
200 | 182 | }  | 
0 commit comments