@Test(expected = IndexNotFoundException.class) public void executeArithmeticThrowsIndexNotFoundException() { String attributeName = "name"; doReturn(attributeName).when(arithmeticCriteria).getAttributeName(); doReturn(null).when(indexes).get(attributeName); handler.executeArithmetic(arithmeticCriteria); }
protected List<Object> executeArithmetic(final ArithmeticCriteria arithmeticCriteria) { final CacheIndex cacheIndex = indexes.get(arithmeticCriteria.getAttributeName()); if (cacheIndex == null) { throw new IndexNotFoundException(); } return arithmeticCriteria.meets(cacheIndex); }
DefaultIndexHandler implements IndexHandler<K, V> { protected List<Object> executeArithmetic(final ArithmeticCriteria arithmeticCriteria) { final CacheIndex cacheIndex = indexes.get(arithmeticCriteria.getAttributeName()); if (cacheIndex == null) { throw new IndexNotFoundException(); } return arithmeticCriteria.meets(cacheIndex); } }
DefaultIndexHandler implements IndexHandler<K, V> { protected List<Object> executeArithmetic(final ArithmeticCriteria arithmeticCriteria) { final CacheIndex cacheIndex = indexes.get(arithmeticCriteria.getAttributeName()); if (cacheIndex == null) { throw new IndexNotFoundException(); } return arithmeticCriteria.meets(cacheIndex); } DefaultIndexHandler(); }
DefaultIndexHandler implements IndexHandler<K, V> { protected List<Object> executeArithmetic(final ArithmeticCriteria arithmeticCriteria) { final CacheIndex cacheIndex = indexes.get(arithmeticCriteria.getAttributeName()); if (cacheIndex == null) { throw new IndexNotFoundException(); } return arithmeticCriteria.meets(cacheIndex); } DefaultIndexHandler(); void addIndex(final String attributeName, final IndexType type); void add(final K key, final V value); void remove(final K key, final V value); void clear(); @SuppressWarnings("unchecked") List<K> execute(final Query query); }
DefaultIndexHandler implements IndexHandler<K, V> { protected List<Object> executeArithmetic(final ArithmeticCriteria arithmeticCriteria) { final CacheIndex cacheIndex = indexes.get(arithmeticCriteria.getAttributeName()); if (cacheIndex == null) { throw new IndexNotFoundException(); } return arithmeticCriteria.meets(cacheIndex); } DefaultIndexHandler(); void addIndex(final String attributeName, final IndexType type); void add(final K key, final V value); void remove(final K key, final V value); void clear(); @SuppressWarnings("unchecked") List<K> execute(final Query query);  }