@Test public void shouldDeriveStartTransactionResponseFromBatchedResponse_singleTransaction() { ConjureStartTransactionsResponse startTransactionResponse = getStartTransactionResponse(12, 1); when(lockLeaseService.startTransactionsWithWatches(version, 1)).thenReturn(startTransactionResponse); StartIdentifiedAtlasDbTransactionResponse response = Iterables.getOnlyElement(transactionStarter.startIdentifiedAtlasDbTransactionBatch(1)); assertDerivableFromBatchedResponse(response, startTransactionResponse); }
List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); }
TransactionStarter implements AutoCloseable { List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); } }
TransactionStarter implements AutoCloseable { List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); } private  TransactionStarter(
            DisruptorAutobatcher<Integer, List<StartIdentifiedAtlasDbTransactionResponse>> autobatcher,
            LockLeaseService lockLeaseService); }
TransactionStarter implements AutoCloseable { List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); } private  TransactionStarter(
            DisruptorAutobatcher<Integer, List<StartIdentifiedAtlasDbTransactionResponse>> autobatcher,
            LockLeaseService lockLeaseService); @Override void close(); }
TransactionStarter implements AutoCloseable { List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { Preconditions.checkArgument(count > 0, "Cannot start 0 or fewer transactions"); return AtlasFutures.getUnchecked(autobatcher.apply(count)); } private  TransactionStarter(
            DisruptorAutobatcher<Integer, List<StartIdentifiedAtlasDbTransactionResponse>> autobatcher,
            LockLeaseService lockLeaseService); @Override void close();  }