@Test public void shouldGetNextBatchThrowExceptionGivenNonPositiveBatchSize() throws Exception { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Batch size should be a positive integer, while 0 given."); defaultPersistenceService.getNextBatch(0); fail(); }
@Override public Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize) { Preconditions.checkArgument(batchMaxSize > 0, "Batch size should be a positive integer."); final String orderingKey = RedisBasedPersistenceServiceConstants.orderingKey(priorityLevel); return getNextBatchOps(orderingKey, batchMaxSize); }
DefaultPersistenceService implements PersistenceService { @Override public Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize) { Preconditions.checkArgument(batchMaxSize > 0, "Batch size should be a positive integer."); final String orderingKey = RedisBasedPersistenceServiceConstants.orderingKey(priorityLevel); return getNextBatchOps(orderingKey, batchMaxSize); } }
DefaultPersistenceService implements PersistenceService { @Override public Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize) { Preconditions.checkArgument(batchMaxSize > 0, "Batch size should be a positive integer."); final String orderingKey = RedisBasedPersistenceServiceConstants.orderingKey(priorityLevel); return getNextBatchOps(orderingKey, batchMaxSize); } @Autowired  DefaultPersistenceService(@Qualifier("orderingTemplate") @NonNull final StringRedisTemplate orderingTemplate,
                                     @Qualifier("valueTemplate") @NonNull final RedisTemplate<String, EmailSchedulingData> valueTemplate); }
DefaultPersistenceService implements PersistenceService { @Override public Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize) { Preconditions.checkArgument(batchMaxSize > 0, "Batch size should be a positive integer."); final String orderingKey = RedisBasedPersistenceServiceConstants.orderingKey(priorityLevel); return getNextBatchOps(orderingKey, batchMaxSize); } @Autowired  DefaultPersistenceService(@Qualifier("orderingTemplate") @NonNull final StringRedisTemplate orderingTemplate,
                                     @Qualifier("valueTemplate") @NonNull final RedisTemplate<String, EmailSchedulingData> valueTemplate); @Override void add(@NonNull final EmailSchedulingData emailSchedulingData); @Override Optional<EmailSchedulingData> get(@NonNull final String id); @Override boolean remove(@NonNull final String id); @Override void addAll(@NonNull final Collection<EmailSchedulingData> emailSchedulingDataList); @Override Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize); @Override Collection<EmailSchedulingData> getNextBatch(final int batchMaxSize); @Override void removeAll(); @Override void removeAll(final int priorityLevel); @Override void removeAll(@NonNull final Collection<String> ids); }
DefaultPersistenceService implements PersistenceService { @Override public Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize) { Preconditions.checkArgument(batchMaxSize > 0, "Batch size should be a positive integer."); final String orderingKey = RedisBasedPersistenceServiceConstants.orderingKey(priorityLevel); return getNextBatchOps(orderingKey, batchMaxSize); } @Autowired  DefaultPersistenceService(@Qualifier("orderingTemplate") @NonNull final StringRedisTemplate orderingTemplate,
                                     @Qualifier("valueTemplate") @NonNull final RedisTemplate<String, EmailSchedulingData> valueTemplate); @Override void add(@NonNull final EmailSchedulingData emailSchedulingData); @Override Optional<EmailSchedulingData> get(@NonNull final String id); @Override boolean remove(@NonNull final String id); @Override void addAll(@NonNull final Collection<EmailSchedulingData> emailSchedulingDataList); @Override Collection<EmailSchedulingData> getNextBatch(final int priorityLevel, final int batchMaxSize); @Override Collection<EmailSchedulingData> getNextBatch(final int batchMaxSize); @Override void removeAll(); @Override void removeAll(final int priorityLevel); @Override void removeAll(@NonNull final Collection<String> ids);  }