@Test
public void testValidScript() throws Exception {

  assumeWindows();
  String expectedResult = "decretedKey";
  // Create a simple script which echoes the given key plus the given
  // expected result (so that we validate both script input and output)
  File scriptFile = new File(TEST_ROOT_DIR, "testScript.cmd");
  FileUtils.writeStringToFile(scriptFile, "@echo %1 " + expectedResult,
          StandardCharsets.UTF_8);
  ShellDecryptionKeyProvider provider = new ShellDecryptionKeyProvider();
  Configuration conf = new Configuration();
  String account = "testacct";
  String key = "key1";
  conf.set(SimpleKeyProvider.KEY_ACCOUNT_KEY_PREFIX + account, key);
  conf.set(ShellDecryptionKeyProvider.KEY_ACCOUNT_SHELLKEYPROVIDER_SCRIPT,
      "cmd /c " + scriptFile.getAbsolutePath());
  String result = provider.getStorageAccountKey(account, conf);
  assertEquals(key + " " + expectedResult, result);
}