diff --git a/code/test/SharedFunctionality.Tests/TemplateValidator/TemplateJsonVerifier.cs b/code/test/SharedFunctionality.Tests/TemplateValidator/TemplateJsonVerifier.cs index 04e2e45ef0..17734a472f 100644 --- a/code/test/SharedFunctionality.Tests/TemplateValidator/TemplateJsonVerifier.cs +++ b/code/test/SharedFunctionality.Tests/TemplateValidator/TemplateJsonVerifier.cs @@ -703,14 +703,14 @@ private static void VerifyLicensesAndProjPostactions(ValidationTemplateInfo temp { if (template.TagsCollection.ContainsKey("ts.licenses") && !string.IsNullOrEmpty(template.TagsCollection["ts.licenses"])) { - if (template.PostActions?.Count == 0) + if (template.PostActionInfos?.Count == 0) { results.Add($"No postaction found for license defined on template {template.Identity}"); } } else { - if (template.PostActions != null && template.PostActions.Any(p => p.ToString("D") == "0B814718-16A3-4F7F-89F1-69C0F9170EAD")) + if (template.PostActionInfos != null && template.PostActionInfos.Any(p => p.ActionId == "0B814718-16A3-4F7F-89F1-69C0F9170EAD")) { results.Add($"Missing license on template {template.Identity}"); } @@ -719,11 +719,10 @@ private static void VerifyLicensesAndProjPostactions(ValidationTemplateInfo temp private static void VerifyPostactionsPath(ValidationTemplateInfo template, List results) { - // TODO: TemplateEngine 7.x packages changed PostActions to just a list of GUIDs. Unclear how to implement this. - //if (template.PostActions != null && template.PostActions.Any(p => p.Args.Any(a => a.Key == "projectPath" && a.Value.Contains("/")))) - //{ - // results.Add("Post-action projectPath should use '\\' instead of '/' to indicate the project file path"); - //} + if (template.PostActionInfos != null && template.PostActionInfos.Any(p => p.Args.Any(a => a.Key == "projectPath" && a.Value.Contains("/")))) + { + results.Add("Post-action projectPath should use '\\' instead of '/' to indicate the project file path"); + } } private static void EnsureValidPrimaryOutputPaths(ValidationTemplateInfo template, List results) diff --git a/code/test/SharedFunctionality.Tests/TemplateValidator/ValidationTemplateInfo.cs b/code/test/SharedFunctionality.Tests/TemplateValidator/ValidationTemplateInfo.cs index b38c0f83d6..386b7f3867 100644 --- a/code/test/SharedFunctionality.Tests/TemplateValidator/ValidationTemplateInfo.cs +++ b/code/test/SharedFunctionality.Tests/TemplateValidator/ValidationTemplateInfo.cs @@ -8,6 +8,7 @@ using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Abstractions.Constraints; using Microsoft.TemplateEngine.Abstractions.Parameters; +using Microsoft.Templates.Core.PostActions; using Newtonsoft.Json; namespace TemplateValidator @@ -103,7 +104,12 @@ public class ValidationTemplateInfo : ITemplateInfo public IParameterDefinitionSet ParameterDefinitions { get; } [ApiAnalysisOptional] - public IReadOnlyList PostActions { get; set; } + [JsonProperty("postActions")] + public List PostActionInfos { get; set; } + + [ApiAnalysisOptional] + [JsonIgnore] + IReadOnlyList ITemplateInfo.PostActions { get; } public string SourceName { get; set; }