MockPersistentStorage implements PersistentStorage { @Override public byte[] getItem(SimpleParamTypes table, URI key) { byte[] item = storage.get(table).get(key); if (item != null) { item = Arrays.copyOf(item, item.length); } return item; } MockPersistentStorage(); @Override void shutdown(); @Override boolean insertItem(SimpleParamTypes table, URI key, byte[] value); @Override int replaceItem(SimpleParamTypes table, URI key, byte[] value); @Override byte[] getItem(SimpleParamTypes table, URI key); @Override byte[] getItemAndDelete(SimpleParamTypes table, URI key); @Override boolean deleteItem(SimpleParamTypes table, URI key); @Override boolean updateItem(SimpleParamTypes table, URI key, byte[] value); @Override List<URI> listItems(SimpleParamTypes table); @Override boolean associatePseudonym(TokenTypes table, URI tokenId, byte[] pseudonymValue); @Override boolean isPseudonymInToken(TokenTypes table, byte[] pseudonymValue); @Override boolean insertCredential(URI key, String username, URI issuer, URI credSpec, byte[] value); @Override byte[] getCredential(URI key, String username); @Override boolean deleteCredential(URI key, String username); @Override boolean updateCredential(URI key, String username, byte[] value); @Override List<URI> listCredentials(String username); @Override List<URI> listCredentials(String username, List<URI> issuerList, List<URI> credSpecList); @Override boolean insertSecret(URI key, String username, byte[] value); @Override byte[] getSecret(URI key, String username); @Override boolean deleteSecret(URI key, String username); @Override boolean updateSecret(URI key, String username, byte[] value); @Override List<URI> listSecrets(String username); @Override boolean insertPseudonym(URI key, String username, String scope, boolean exclusive,
      byte[] pseudonymValue, byte[] data); @Override byte[] getPseudonym(URI key, String username); @Override boolean deletePseudonym(URI key, String username); @Override boolean updatePseudonym(URI key, String username, byte[] value); @Override List<URI> listPseudonyms(String username); @Override List<URI> listPseudonyms(String username, String scope); @Override List<URI> listPseudonyms(String username, String scope, boolean isExclusive); @Override List<URI> listPseudonyms(String username, byte[] pseudonymValue); @Override boolean insertRevocationInformation(URI key, URI rev_auth, Calendar created, byte[] data); @Override byte[] getRevocationInformation(URI key, URI rev_auth); @Override byte[] getLatestRevocationInformation(URI rev_auth);  }
@Test public void testGetWithoutItem() { SimpleParamTypes table = SimpleParamTypes.TEST_TABLE; String prefix = UUID.randomUUID().toString(); URI key = URI.create("test-"+prefix); assertNull(ps.getItem(table, key)); }