### Question:
ProvisioningService extends AbstractIdleService { @VisibleForTesting static Map<String, String> evaluateMacros(SecureStore secureStore, String user, String namespace, Map<String, String> properties) { MacroEvaluator evaluator = new ProvisionerMacroEvaluator(namespace, secureStore); MacroParser macroParser = new MacroParser(evaluator, MacroParserOptions.builder() .disableLookups() .setFunctionWhitelist(ProvisionerMacroEvaluator.SECURE_FUNCTION) .setEscaping(false) .build()); Map<String, String> evaluated = new HashMap<>(); String oldUser = SecurityRequestContext.getUserId(); try { SecurityRequestContext.setUserId(user); for (Map.Entry<String, String> property : properties.entrySet()) { String key = property.getKey(); String val = property.getValue(); evaluated.put(key, macroParser.parse(val)); } } finally { SecurityRequestContext.setUserId(oldUser); } return evaluated; } @Inject  ProvisioningService(CConfiguration cConf, ProvisionerProvider provisionerProvider,
                      ProvisionerConfigProvider provisionerConfigProvider,
                      ProvisionerNotifier provisionerNotifier, LocationFactory locationFactory,
                      SecureStore secureStore, ProgramStateWriter programStateWriter,
                      ProvisionerStore provisionerStore, TransactionRunner transactionRunner,
                      MetricsCollectionService metricsCollectionService); ClusterStatus getClusterStatus(ProgramRunId programRunId, ProgramOptions programOptions,
                                        Cluster cluster, String userId); Optional<ProvisioningTaskInfo> cancelProvisionTask(ProgramRunId programRunId); Runnable provision(ProvisionRequest provisionRequest, StructuredTableContext context); Optional<RuntimeJobManager> getRuntimeJobManager(ProgramRunId programRunId, ProgramOptions programOptions); Runnable deprovision(ProgramRunId programRunId, StructuredTableContext context); Collection<ProvisionerDetail> getProvisionerDetails(); @Nullable ProvisionerDetail getProvisionerDetail(String name); void validateProperties(String provisionerName, Map<String, String> properties);  }### Answer:
@Test public void testSecureMacroEvaluation() { String key = "key"; String keycontent = "somecontent"; Map<String, String> properties = ImmutableMap.of("x", "${secure(" + key + ")}"); SecureStore secureStore = FakeSecureStore.builder() .putValue(NamespaceId.DEFAULT.getNamespace(), key, keycontent) .build(); Map<String, String> evaluated = ProvisioningService.evaluateMacros(secureStore, "Bob", NamespaceId.DEFAULT.getNamespace(), properties); Assert.assertEquals(keycontent, evaluated.get("x")); }