Skip to content

Commit fb3e4dc

Browse files
committed
revert aspect and add tests
1 parent 6546fab commit fb3e4dc

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

libraries/src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="AspectInjector" Version="2.8.2" />
6+
<PackageVersion Include="AspectInjector" Version="2.8.1" />
77
<PackageVersion Include="Amazon.Lambda.Core" Version="2.1.0" />
88
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="3.7.201.7" />
99
<PackageVersion Include="AWSXRayRecorder.Handlers.AwsSdk" Version="2.12.0" />

libraries/tests/AWS.Lambda.Powertools.Common.Tests/Core/PowertoolsEnvironmentTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Xml.Linq;
6+
using System.Xml.XPath;
37
using Xunit;
48

59
namespace AWS.Lambda.Powertools.Common.Tests;
@@ -60,6 +64,25 @@ public void Set_Execution_Real_Environment()
6064
Assert.Equal($"{Constants.FeatureContextIdentifier}/Tests/1.0.0", systemWrapper.GetEnvironmentVariable("AWS_EXECUTION_ENV"));
6165
}
6266

67+
[Fact]
68+
public void Should_Use_Aspect_Injector_281()
69+
{
70+
// This test must be present until Issue: https://github.com/pamidur/aspect-injector/issues/220 is fixed
71+
72+
var directory = Path.GetFullPath("../../../../../src/Directory.Packages.props");
73+
var doc = XDocument.Load(directory);
74+
75+
var packageReference = doc.XPathSelectElements("//PackageVersion")
76+
.Select(pr => new
77+
{
78+
Include = pr.Attribute("Include")!.Value,
79+
Version = new Version(pr.Attribute("Version")!.Value)
80+
}).FirstOrDefault(x => x.Include == "AspectInjector");
81+
82+
Assert.NotNull(packageReference);
83+
Assert.Equal("2.8.1", packageReference.Version.ToString());
84+
}
85+
6386
public void Dispose()
6487
{
6588
//Do cleanup actions here

0 commit comments

Comments
 (0)