AES128Cryptor extends AESCryptorAbstract { @Override protected String getKey() { String key = CryptorFactory.loadKeyFromFile("AES128Cryptor"); if (key != null) { return key; } else { return "72d93747ba0162f2f2985f5cb3e24b30"; } } AES128Cryptor(); @Override String encrypt(String str); @Override String decrypt(String str); @Override String newKey();  }
@Test public void testGetKey() { try { System.out.println("getKey"); AES128Cryptor instance = new AES128Cryptor(); String result = instance.getKey(); assertNotNull(result); } catch (NoSuchAlgorithmException ex) { Logger.getLogger(AES128CryptorTest.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidKeySpecException ex) { Logger.getLogger(AES128CryptorTest.class.getName()).log(Level.SEVERE, null, ex); } catch (NoSuchPaddingException ex) { Logger.getLogger(AES128CryptorTest.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidKeyException ex) { Logger.getLogger(AES128CryptorTest.class.getName()).log(Level.SEVERE, null, ex); } }