File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,21 @@ public void usesPreparedTransaction() {
234234 com .google .protobuf .Timestamp .newBuilder ()
235235 .setSeconds (System .currentTimeMillis () * 1000 ))
236236 .build ()));
237+ when (rpc .createSession (
238+ Mockito .anyString (),
239+ Mockito .anyString (),
240+ Mockito .anyMap (),
241+ Mockito .eq (null ),
242+ Mockito .eq (true )))
243+ .thenAnswer (
244+ invocation ->
245+ Session .newBuilder ()
246+ .setName (invocation .getArguments ()[0 ] + "/sessions/1" )
247+ .setMultiplexed (true )
248+ .setCreateTime (
249+ com .google .protobuf .Timestamp .newBuilder ()
250+ .setSeconds (System .currentTimeMillis () * 1000 ))
251+ .build ());
237252 when (rpc .beginTransactionAsync (
238253 Mockito .any (BeginTransactionRequest .class ), Mockito .anyMap (), eq (true )))
239254 .thenAnswer (
@@ -300,6 +315,21 @@ public void inlineBegin() {
300315 com .google .protobuf .Timestamp .newBuilder ()
301316 .setSeconds (System .currentTimeMillis () * 1000 ))
302317 .build ()));
318+ when (rpc .createSession (
319+ Mockito .anyString (),
320+ Mockito .anyString (),
321+ Mockito .anyMap (),
322+ Mockito .eq (null ),
323+ Mockito .eq (true )))
324+ .thenAnswer (
325+ invocation ->
326+ Session .newBuilder ()
327+ .setName (invocation .getArguments ()[0 ] + "/sessions/1" )
328+ .setMultiplexed (true )
329+ .setCreateTime (
330+ com .google .protobuf .Timestamp .newBuilder ()
331+ .setSeconds (System .currentTimeMillis () * 1000 ))
332+ .build ());
303333 when (rpc .beginTransactionAsync (
304334 Mockito .any (BeginTransactionRequest .class ), Mockito .anyMap (), eq (true )))
305335 .thenAnswer (
Original file line number Diff line number Diff line change @@ -186,6 +186,21 @@ public void usesPreparedTransaction() {
186186 .setCreateTime (
187187 Timestamp .newBuilder ().setSeconds (System .currentTimeMillis () * 1000 ))
188188 .build ()));
189+ when (rpc .createSession (
190+ Mockito .anyString (),
191+ Mockito .anyString (),
192+ Mockito .anyMap (),
193+ Mockito .eq (null ),
194+ Mockito .eq (true )))
195+ .thenAnswer (
196+ invocation ->
197+ Session .newBuilder ()
198+ .setName (invocation .getArguments ()[0 ] + "/sessions/1" )
199+ .setMultiplexed (true )
200+ .setCreateTime (
201+ com .google .protobuf .Timestamp .newBuilder ()
202+ .setSeconds (System .currentTimeMillis () * 1000 ))
203+ .build ());
189204 when (rpc .beginTransactionAsync (
190205 Mockito .any (BeginTransactionRequest .class ), Mockito .anyMap (), eq (true )))
191206 .thenAnswer (
You can’t perform that action at this time.
0 commit comments