File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1481,6 +1481,8 @@ public void testSessionNotFoundReadWriteTransaction() {
1481
1481
when (closedSession .getName ())
1482
1482
.thenReturn ("projects/dummy/instances/dummy/database/dummy/sessions/session-closed" );
1483
1483
when (closedSession .getErrorHandler ()).thenReturn (DefaultErrorHandler .INSTANCE );
1484
+ when (closedSession .getRequestIdCreator ())
1485
+ .thenReturn (new XGoogSpannerRequestId .NoopRequestIdCreator ());
1484
1486
1485
1487
Span oTspan = mock (Span .class );
1486
1488
ISpan span = new OpenTelemetrySpan (oTspan );
@@ -1521,6 +1523,8 @@ public void testSessionNotFoundReadWriteTransaction() {
1521
1523
TransactionRunnerImpl openTransactionRunner = new TransactionRunnerImpl (openSession );
1522
1524
openTransactionRunner .setSpan (span );
1523
1525
when (openSession .readWriteTransaction ()).thenReturn (openTransactionRunner );
1526
+ when (openSession .getRequestIdCreator ())
1527
+ .thenReturn (new XGoogSpannerRequestId .NoopRequestIdCreator ());
1524
1528
1525
1529
ResultSet openResultSet = mock (ResultSet .class );
1526
1530
when (openResultSet .next ()).thenReturn (true , false );
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ public void setup() {
67
67
.setCommitTimestamp (Timestamp .newBuilder ().setSeconds (99L ).setNanos (10 ).build ())
68
68
.build ()));
69
69
when (session .getName ()).thenReturn ("test" );
70
+ when (session .getRequestIdCreator ())
71
+ .thenReturn (new XGoogSpannerRequestId .NoopRequestIdCreator ());
70
72
doNothing ().when (span ).setStatus (any (Throwable .class ));
71
73
doNothing ().when (span ).end ();
72
74
doNothing ().when (span ).addAnnotation ("Starting Commit" );
@@ -210,6 +212,8 @@ public void testReturnCommitStats() {
210
212
private void batchDml (int status ) {
211
213
SessionImpl session = mock (SessionImpl .class );
212
214
when (session .getName ()).thenReturn ("test" );
215
+ when (session .getRequestIdCreator ())
216
+ .thenReturn (new XGoogSpannerRequestId .NoopRequestIdCreator ());
213
217
SpannerRpc rpc = mock (SpannerRpc .class );
214
218
ExecuteBatchDmlResponse response =
215
219
ExecuteBatchDmlResponse .newBuilder ()
You can’t perform that action at this time.
0 commit comments