StorageAccountProviderSimpleBindingImpl implements StorageAccountProviderBinding { @Override public StorageAccount getAccountFromXml(Element xml) { StorageProviderType acctType = getStorageProviderType(xml); String storageAccountId = getAccountId(xml); boolean primary = getIsPrimary(xml); Credential credential = getCredential(xml); Map<String, String> options = getStorageProviderOptions(xml); StorageAccount storageAccount = null; if (storageAccountId != null && acctType != null && !acctType.equals( StorageProviderType.UNKNOWN)) { storageAccount = new StorageAccountImpl(storageAccountId, credential.getUsername(), credential.getPassword(), acctType); for (String key : options.keySet()) { storageAccount.setOption(key, options.get(key)); } storageAccount.setPrimary(primary); } else { StringBuilder sb = new StringBuilder(); sb.append("While creating storage account list, skipping simple "); sb.append("storage account with storageAccountId '"); sb.append(storageAccountId); sb.append("' due to either a missing storageAccountId, "); sb.append("an unsupported type '"); sb.append(acctType); sb.append("', or a missing username or password"); log.warn(sb.toString()); } return storageAccount; } StorageAccountProviderSimpleBindingImpl(); @Override StorageAccount getAccountFromXml(Element xml); @Override Element getElementFrom(StorageAccount acct,
                                  boolean includeCredentials,
                                  boolean includeHiddenOptions);  }
@Test public void testGetAccountFromXml() throws Exception { boolean include = true; StorageAccount acct = createAccount(); Element xml = createAccountXml(acct, include); boolean valid = true; StorageAccount result = doTest(xml, valid); Assert.assertNotNull(result); Assert.assertEquals(acct, result); }