File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import static org .junit .Assert .assertEquals ;
20
20
import static org .junit .Assert .assertFalse ;
21
- import static org .junit .Assert .assertNotNull ;
22
21
import static org .junit .Assert .assertThrows ;
23
22
import static org .junit .Assert .assertTrue ;
24
23
@@ -754,12 +753,8 @@ public void testTransactionRunnerWithRetryOnBeginTransaction() {
754
753
755
754
private void verifyAtLeast1SpanHasXGoogSpannerRequestIdAttribute (List <SpanData > finishedSpans ) {
756
755
AttributeKey <String > attributeKey = AttributeKey .stringKey ("x_goog_spanner_request_id" );
757
- SpanData matchedSpan =
758
- finishedSpans .stream ()
759
- .filter (span -> !span .getAttributes ().get (attributeKey ).isEmpty ())
760
- .findAny ()
761
- .orElseThrow (IllegalStateException ::new );
762
- assertNotNull (matchedSpan );
756
+ assertTrue (
757
+ finishedSpans .stream ().anyMatch (span -> !span .getAttributes ().get (attributeKey ).isEmpty ()));
763
758
}
764
759
765
760
@ Test
You can’t perform that action at this time.
0 commit comments