@Test public void testGenerateExceptions() { try { cut.generateKey(null); fail("Expected exception"); } catch (InvalidParameterException ex) { } }
@Override public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } }
DefaultKeyProvider implements KeyProvider { @Override public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } } }
DefaultKeyProvider implements KeyProvider { @Override public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } }  }
DefaultKeyProvider implements KeyProvider { @Override public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } }  void setMethodStore(final CacheKeyMethodStore methodStore); CacheKeyMethodStore getMethodStore(); @Override String generateKey(final Object keyObject); @Override String[] generateKeys(final Object[] keyObjects); }
DefaultKeyProvider implements KeyProvider { @Override public String generateKey(final Object keyObject) { if (keyObject == null) { throw new InvalidParameterException("keyObject must be defined"); } try { final Method keyMethod = getKeyMethod(keyObject); return generateObjectId(keyMethod, keyObject); } catch (Exception ex) { throw new RuntimeException(ex); } }  void setMethodStore(final CacheKeyMethodStore methodStore); CacheKeyMethodStore getMethodStore(); @Override String generateKey(final Object keyObject); @Override String[] generateKeys(final Object[] keyObjects);  }