@Test public void should_increment_for_bulk() throws ContentAddressableStorageDatabaseException { assertThat(mongoRule.getMongoCollection(OfferCollections.OFFER_SEQUENCE.getName()).find()) .hasSize(0); long nextSequence1 = service.getNextSequence(OfferSequenceDatabaseService.BACKUP_LOG_SEQUENCE_ID, 5L); assertThat(nextSequence1).isEqualTo(1L); assertThat(mongoRule.getMongoCollection(OfferCollections.OFFER_SEQUENCE.getName()).find()) .hasSize(1) .extracting("Counter").containsExactly(5L); long nextSequence2 = service.getNextSequence(OfferSequenceDatabaseService.BACKUP_LOG_SEQUENCE_ID, 3L); assertThat(nextSequence2).isEqualTo(6L); assertThat(mongoRule.getMongoCollection(OfferCollections.OFFER_SEQUENCE.getName()).find()) .hasSize(1) .extracting("Counter").containsExactly(8L); }
public long getNextSequence(String sequenceId) throws ContentAddressableStorageDatabaseException { return getNextSequence(sequenceId, 1L); }
OfferSequenceDatabaseService { public long getNextSequence(String sequenceId) throws ContentAddressableStorageDatabaseException { return getNextSequence(sequenceId, 1L); } }
OfferSequenceDatabaseService { public long getNextSequence(String sequenceId) throws ContentAddressableStorageDatabaseException { return getNextSequence(sequenceId, 1L); } OfferSequenceDatabaseService(MongoCollection<Document> mongoCollection); }
OfferSequenceDatabaseService { public long getNextSequence(String sequenceId) throws ContentAddressableStorageDatabaseException { return getNextSequence(sequenceId, 1L); } OfferSequenceDatabaseService(MongoCollection<Document> mongoCollection); long getNextSequence(String sequenceId); long getNextSequence(String sequenceId, long inc); }
OfferSequenceDatabaseService { public long getNextSequence(String sequenceId) throws ContentAddressableStorageDatabaseException { return getNextSequence(sequenceId, 1L); } OfferSequenceDatabaseService(MongoCollection<Document> mongoCollection); long getNextSequence(String sequenceId); long getNextSequence(String sequenceId, long inc); static final String BACKUP_LOG_SEQUENCE_ID; }