@Test public void shouldNotFailToEncryptKey() { SessionID key = mock(SessionID.class); given(key.getExtension(SessionID.STORAGE_KEY)).willReturn("badger"); KeyConversion conversion = new KeyConversion(); String result = conversion.encryptKey(key); assertNotNull(result); }
public String encryptKey(SessionID key) { try { return SessionUtils.getEncryptedStorageKey(key); } catch (Exception e) { String message = MessageFormat.format( "Failed to create encrypted storage key for:\n" + "Session ID: {0}", key); throw new IllegalStateException(message, e); } }
KeyConversion { public String encryptKey(SessionID key) { try { return SessionUtils.getEncryptedStorageKey(key); } catch (Exception e) { String message = MessageFormat.format( "Failed to create encrypted storage key for:\n" + "Session ID: {0}", key); throw new IllegalStateException(message, e); } } }
KeyConversion { public String encryptKey(SessionID key) { try { return SessionUtils.getEncryptedStorageKey(key); } catch (Exception e) { String message = MessageFormat.format( "Failed to create encrypted storage key for:\n" + "Session ID: {0}", key); throw new IllegalStateException(message, e); } }  }
KeyConversion { public String encryptKey(SessionID key) { try { return SessionUtils.getEncryptedStorageKey(key); } catch (Exception e) { String message = MessageFormat.format( "Failed to create encrypted storage key for:\n" + "Session ID: {0}", key); throw new IllegalStateException(message, e); } }  String encodeKey(final String key); String decodeKey(final String hexEncodedKey); String encryptKey(SessionID key); }
KeyConversion { public String encryptKey(SessionID key) { try { return SessionUtils.getEncryptedStorageKey(key); } catch (Exception e) { String message = MessageFormat.format( "Failed to create encrypted storage key for:\n" + "Session ID: {0}", key); throw new IllegalStateException(message, e); } }  String encodeKey(final String key); String decodeKey(final String hexEncodedKey); String encryptKey(SessionID key);  }