Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit 96babaf

Browse files
authored
chore: use arcus testing (#292)
* chore: use arcus testing * pr-fix: use v0.5 of arcus testing * pr-fix: update w/ guard v2
1 parent c01648c commit 96babaf

File tree

7 files changed

+10
-66
lines changed

7 files changed

+10
-66
lines changed

src/Arcus.EventGrid.Tests.Core/Arcus.EventGrid.Tests.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Arcus.Security.Core" Version="1.9.0" />
8+
<PackageReference Include="Guard.Net" Version="2.0.0" />
99
<PackageReference Include="xunit.assert" Version="2.4.0" />
1010
<PackageReference Include="Azure.Messaging.EventGrid" Version="4.11.0" />
1111
</ItemGroup>

src/Arcus.EventGrid.Tests.Core/Security/StaticInMemorySecretProvider.cs

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/Arcus.EventGrid.Tests.Integration/Arcus.EventGrid.Tests.Integration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ItemGroup>
88
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
99
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
10-
<PackageReference Include="Arcus.Testing.Logging" Version="0.3.0" />
11-
<PackageReference Include="Arcus.Testing.Security.Providers.InMemory" Version="0.3.0" />
10+
<PackageReference Include="Arcus.Testing.Logging" Version="0.5.0" />
11+
<PackageReference Include="Arcus.Testing.Security.Providers.InMemory" Version="0.5.0" />
1212
<PackageReference Include="Bogus" Version="29.0.2" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
1414
<PackageReference Include="xunit" Version="2.4.0" />

src/Arcus.EventGrid.Tests.Integration/Publishing/EventGridPublisherClientWithTrackingResilienceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
33
using Arcus.EventGrid.Tests.Core.Events.Data;
4-
using Arcus.EventGrid.Tests.Core.Security;
54
using Arcus.EventGrid.Tests.Integration.Publishing.Fixture;
65
using Arcus.Observability.Correlation;
76
using Azure;
@@ -10,6 +9,7 @@
109
using Bogus;
1110
using Microsoft.Extensions.Azure;
1211
using Microsoft.Extensions.DependencyInjection;
12+
using Microsoft.Extensions.Hosting;
1313
using Xunit;
1414

1515
namespace Arcus.EventGrid.Tests.Integration.Publishing
@@ -29,7 +29,7 @@ public async Task SendToTopicEndpoint_WithExponentialRetry_TriesSeveralTimes()
2929
var authenticationKeySecretName = "My-Auth-Key";
3030
var retryCount = BogusGenerator.Random.Int(min: 1, max: 3);
3131
var services = new ServiceCollection();
32-
services.AddSecretStore(stores => stores.AddProvider(new StaticInMemorySecretProvider(authenticationKeySecretName, "some super secret auth key")));
32+
services.AddSecretStore(stores => stores.AddInMemory(authenticationKeySecretName, "some super secret auth key"));
3333
services.AddCorrelation();
3434
services.AddAzureClients(clients =>
3535
{
@@ -81,7 +81,7 @@ public async Task SendToTopicEndpoint_WithCircuitBreaker_TriesSeveralTimes()
8181
var authenticationKeySecretName = "My-Auth-Key";
8282
var exceptionsAllowedBeforeBreaking = BogusGenerator.Random.Int(min: 1, max: 3);
8383
var services = new ServiceCollection();
84-
services.AddSecretStore(stores => stores.AddProvider(new StaticInMemorySecretProvider(authenticationKeySecretName, "some super secret auth key")));
84+
services.AddSecretStore(stores => stores.AddInMemory(authenticationKeySecretName, "some super secret auth key"));
8585
services.AddCorrelation();
8686
services.AddAzureClients(clients =>
8787
{
@@ -115,7 +115,7 @@ public async Task SendToTopicEndpoint_WithExponentialRetryWithCircuitBreaker_Tri
115115
var retryCount = BogusGenerator.Random.Int(min: 1, max: 3);
116116
var exceptionsAllowedBeforeBreaking = BogusGenerator.Random.Int(min: 1, max: 3);
117117
var services = new ServiceCollection();
118-
services.AddSecretStore(stores => stores.AddProvider(new StaticInMemorySecretProvider(authenticationKeySecretName, "some super secret auth key")));
118+
services.AddSecretStore(stores => stores.AddInMemory(authenticationKeySecretName, "some super secret auth key"));
119119
services.AddCorrelation();
120120
services.AddAzureClients(clients =>
121121
{

src/Arcus.EventGrid.Tests.Integration/Publishing/EventGridPublisherClientWithTrackingTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Threading.Tasks;
55
using Arcus.EventGrid.Contracts;
66
using Arcus.EventGrid.Core;
7-
using Arcus.EventGrid.Tests.Core.Security;
87
using Arcus.EventGrid.Tests.Integration.Fixture;
98
using Arcus.EventGrid.Tests.Integration.Publishing.Fixture;
109
using Arcus.Observability.Correlation;
@@ -15,6 +14,7 @@
1514
using Bogus;
1615
using Microsoft.Extensions.Azure;
1716
using Microsoft.Extensions.DependencyInjection;
17+
using Microsoft.Extensions.Hosting;
1818
using Microsoft.Extensions.Logging;
1919
using Xunit;
2020
using Xunit.Abstractions;
@@ -238,7 +238,7 @@ protected EventGridPublisherClient CreateRegisteredClient(
238238
string authenticationKey = Configuration.GetEventGridEndpointKey(_eventSchema);
239239
string authenticationKeySecretName = "Arcus_EventGrid_AuthenticationKey";
240240

241-
services.AddSecretStore(stores => stores.AddProvider(new StaticInMemorySecretProvider(authenticationKeySecretName, authenticationKey)));
241+
services.AddSecretStore(stores => stores.AddInMemory(authenticationKeySecretName, authenticationKey));
242242
services.AddAzureClients(clients => registration(clients, topicEndpoint, authenticationKeySecretName));
243243

244244
IServiceProvider provider = services.BuildServiceProvider();

src/Arcus.EventGrid.Tests.Unit/Arcus.EventGrid.Tests.Unit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Arcus.Testing.Security.Providers.InMemory" Version="0.3.0" />
9+
<PackageReference Include="Arcus.Testing.Security.Providers.InMemory" Version="0.5.0" />
1010
<PackageReference Include="Bogus" Version="29.0.2" />
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
1212
<PackageReference Include="Moq" Version="4.18.2" />

src/Arcus.EventGrid.Tests.Unit/Publishing/AzureClientFactoryBuilderExtensionsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using Arcus.EventGrid.Tests.Core.Security;
32
using Arcus.EventGrid.Tests.Unit.Publishing.Fixtures;
43
using Azure.Messaging.EventGrid;
54
using Microsoft.Extensions.Azure;

0 commit comments

Comments
 (0)