@@ -112,12 +112,11 @@ public void test_lifecycle() throws IOException, TimeoutException {
112112
113113 // Act: delete data and restore backup #1
114114 client .collections .delete (nsA );
115- client .backup .restore (backup_1 , backend , restore -> restore .includeCollections (nsA ));
115+ var restoreMe = client .backup .restore (backup_1 , backend , restore -> restore .includeCollections (nsA ));
116+ restoreMe .waitForCompletion (client );
116117
117118 // Assert: object inserted in the beginning of the test is present
118- var restore_1 = client .backup .getRestoreStatus (backup_1 , backend )
119- .orElseThrow ().waitForCompletion (client );
120- Assertions .assertThat (restore_1 ).as ("restore backup #1" )
119+ Assertions .assertThat (restoreMe ).as ("restore backup #1" )
121120 .returns (BackupStatus .SUCCESS , Backup ::status );
122121 Assertions .assertThat (collectionA .size ()).as ("after restore backup #1" ).isEqualTo (1 );
123122 }
@@ -215,10 +214,10 @@ public void test_lifecycle_async() throws ExecutionException, InterruptedExcepti
215214
216215 // Act: delete data and restore backup #1
217216 async .collections .delete (nsA ).join ();
218- async .backup .restore (backup_1 , backend , restore -> restore .includeCollections (nsA )).join ();
217+ var restore_1 = async .backup .restore (backup_1 , backend , restore -> restore .includeCollections (nsA )).join ();
219218
220219 // Assert: object inserted in the beginning of the test is present
221- var restore_1 = async .backup .getRestoreStatus (backup_1 , backend )
220+ restore_1 = async .backup .getRestoreStatus (backup_1 , backend )
222221 .thenCompose (bak -> bak .orElseThrow ().waitForCompletion (async ))
223222 .join ();
224223 Assertions .assertThat (restore_1 ).as ("restore backup #1" )
0 commit comments