@Override
  public String getStorageAccountKey(String accountName, Configuration conf)
      throws KeyProviderException {
    String envelope = super.getStorageAccountKey(accountName, conf);

    final String command = conf.get(KEY_ACCOUNT_SHELLKEYPROVIDER_SCRIPT);
    if (command == null) {
      throw new KeyProviderException(
          "Script path is not specified via fs.azure.shellkeyprovider.script");
    }

    String[] cmd = command.split(" ");
    String[] cmdWithEnvelope = Arrays.copyOf(cmd, cmd.length + 1);
    cmdWithEnvelope[cmdWithEnvelope.length - 1] = envelope;

    String decryptedKey = null;
    try {
      decryptedKey = Shell.execCommand(cmdWithEnvelope);
    } catch (IOException ex) {
      throw new KeyProviderException(ex);
    }

    // trim any whitespace
    return decryptedKey.trim();
  }
@Test
  public void testScriptPathNotSpecified() throws Exception {
    assumeWindows();
    ShellDecryptionKeyProvider provider = new ShellDecryptionKeyProvider();
    Configuration conf = new Configuration();
    String account = "testacct";
    String key = "key";

    conf.set(SimpleKeyProvider.KEY_ACCOUNT_KEY_PREFIX + account, key);
    try {
      provider.getStorageAccountKey(account, conf);
      Assert
          .fail("fs.azure.shellkeyprovider.script is not specified, we should throw");
    } catch (KeyProviderException e) {
      LOG.info("Received an expected exception: " + e.getMessage());
    }
  }