HibernateReservedValueStore extends HibernateGenericStore<ReservedValue> implements ReservedValueStore { @Override public void removeExpiredReservations() { getQuery( "DELETE FROM ReservedValue WHERE expiryDate < :now" ) .setParameter( "now", new Date() ) .executeUpdate(); } HibernateReservedValueStore( SessionFactory sessionFactory, JdbcTemplate jdbcTemplate,
        ApplicationEventPublisher publisher, BatchHandlerFactory batchHandlerFactory ); @Override List<ReservedValue> reserveValues( ReservedValue reservedValue,
        List<String> values ); @Override List<ReservedValue> reserveValuesJpa( ReservedValue reservedValue, List<String> values ); @Override List<ReservedValue> getIfReservedValues( ReservedValue reservedValue,
        List<String> values ); @Override int getNumberOfUsedValues( ReservedValue reservedValue ); @Override void removeExpiredReservations(); @Override boolean useReservedValue( String ownerUID, String value ); @Override void deleteReservedValueByUid( String uid ); @Override boolean isReserved( String ownerObject, String ownerUID, String value );  }
@Test public void removeExpiredReservationsDoesNotRemoveAnythingIfNothingHasExpired() { int num = reservedValueStore.getCount(); reservedValueStore.removeExpiredReservations(); assertEquals( num, reservedValueStore.getCount() ); }