diff --git a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiPathItemExtensionsTests.cs b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiPathItemExtensionsTests.cs index bd8a8318..70ee1290 100644 --- a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiPathItemExtensionsTests.cs +++ b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiPathItemExtensionsTests.cs @@ -108,6 +108,12 @@ public void ExtractApiPathAuthorization( }, }; + if (expectedUseAllowAnonymous is null) + { + apiPath.Extensions.Remove(SecurityExtensionNameConstants.AuthenticationRequired); + apiPath.Operations.Values.First().Extensions.Remove(SecurityExtensionNameConstants.AuthenticationRequired); + } + // Act var result = apiPath.ExtractApiPathAuthorization();