From a6da36b6c006296d0b3fb11b41fc14fc01300167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Stenr=C3=B8jl?= Date: Tue, 1 Oct 2024 09:45:24 +0200 Subject: [PATCH 1/4] Use pre-release of TestCommon --- .../dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj | 2 +- .../Fixture/ServiceBusIntegrationEventSenderFixture.cs | 3 ++- .../Fixtures/OrchestrationsAppFixture.cs | 6 ++++-- source/dotnet/wholesale-api/Test.Core/Test.Core.csproj | 4 ++-- .../TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs | 3 ++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj index 425f871d1a..6777606897 100644 --- a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj +++ b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj @@ -6,7 +6,7 @@ true - + all diff --git a/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs b/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs index 4753636e27..58fd653e45 100644 --- a/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs +++ b/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs @@ -38,7 +38,8 @@ public ServiceBusIntegrationEventSenderFixture() var integrationTestConfiguration = new IntegrationTestConfiguration(); _serviceBusResourceProvider = new ServiceBusResourceProvider( new TestDiagnosticsLogger(), - integrationTestConfiguration.ServiceBusFullyQualifiedNamespace); + integrationTestConfiguration.ServiceBusFullyQualifiedNamespace, + integrationTestConfiguration.Credential); ServiceBusClient = new ServiceBusClient(integrationTestConfiguration.ServiceBusFullyQualifiedNamespace, new DefaultAzureCredential()); diff --git a/source/dotnet/wholesale-api/Orchestrations.IntegrationTests/Fixtures/OrchestrationsAppFixture.cs b/source/dotnet/wholesale-api/Orchestrations.IntegrationTests/Fixtures/OrchestrationsAppFixture.cs index e3d67e6e03..2a4bb2210f 100644 --- a/source/dotnet/wholesale-api/Orchestrations.IntegrationTests/Fixtures/OrchestrationsAppFixture.cs +++ b/source/dotnet/wholesale-api/Orchestrations.IntegrationTests/Fixtures/OrchestrationsAppFixture.cs @@ -76,11 +76,13 @@ public OrchestrationsAppFixture() ServiceBusResourceProvider = new ServiceBusResourceProvider( TestLogger, - IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace); + IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace, + IntegrationTestConfiguration.Credential); ServiceBusListenerMock = new ServiceBusListenerMock( TestLogger, - IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace); + IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace, + IntegrationTestConfiguration.Credential); HostConfigurationBuilder = new FunctionAppHostConfigurationBuilder(); diff --git a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj index 0df6a7852b..2d0af81a04 100644 --- a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj +++ b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj @@ -19,8 +19,8 @@ limitations under the License. Energinet.DataHub.Wholesale.Test.Core - - + + all diff --git a/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs b/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs index d86b560408..c60c5908d1 100644 --- a/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs +++ b/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs @@ -43,7 +43,8 @@ public WholesaleWebApiFixture() ServiceBusResourceProvider = new ServiceBusResourceProvider( TestLogger, - IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace); + IntegrationTestConfiguration.ServiceBusFullyQualifiedNamespace, + IntegrationTestConfiguration.Credential); } public WholesaleDatabaseManager DatabaseManager { get; } From 87d25b17eae00ebdf9578f902cc911c0e69c2db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Stenr=C3=B8jl?= Date: Tue, 1 Oct 2024 17:34:24 +0200 Subject: [PATCH 2/4] Refactor use of DefaultAzureCredential in integration tests --- .../Fixture/ServiceBusIntegrationEventSenderFixture.cs | 4 +++- .../TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs b/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs index 58fd653e45..98ad1b23e0 100644 --- a/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs +++ b/source/dotnet/wholesale-api/Events/Events.IntegrationTests/Fixture/ServiceBusIntegrationEventSenderFixture.cs @@ -41,7 +41,9 @@ public ServiceBusIntegrationEventSenderFixture() integrationTestConfiguration.ServiceBusFullyQualifiedNamespace, integrationTestConfiguration.Credential); - ServiceBusClient = new ServiceBusClient(integrationTestConfiguration.ServiceBusFullyQualifiedNamespace, new DefaultAzureCredential()); + ServiceBusClient = new ServiceBusClient( + integrationTestConfiguration.ServiceBusFullyQualifiedNamespace, + integrationTestConfiguration.Credential); IntegrationEventsOptions = Options.Create( new IntegrationEventsOptions diff --git a/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs b/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs index c60c5908d1..07b66fdea9 100644 --- a/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs +++ b/source/dotnet/wholesale-api/WebApi.IntegrationTests/Fixtures/TestCommon/Fixture/WebApi/WholesaleWebApiFixture.cs @@ -119,13 +119,13 @@ protected override Task OnDisposeWebApiDependenciesAsync() } /// - /// Create storage container. Note: Azurite is based on the Blob Storage API, but sinceData Lake Storage Gen2 is built on top of it, we can still create the container like this + /// Create storage container. Note: Azurite is based on the Blob Storage API, but since Data Lake Storage Gen2 is built on top of it, we can still create the container like this /// private async Task EnsureCalculationStorageContainerExistsAsync() { var dataLakeServiceClient = new DataLakeServiceClient( serviceUri: AzuriteManager.BlobStorageServiceUri, - credential: new DefaultAzureCredential()); + credential: IntegrationTestConfiguration.Credential); var fileSystemClient = dataLakeServiceClient.GetFileSystemClient( Environment.GetEnvironmentVariable(nameof(DataLakeOptions.STORAGE_CONTAINER_NAME))); From 13a3ee13c263b8c932cc45b25ccfed35141cff4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Stenr=C3=B8jl?= Date: Wed, 2 Oct 2024 08:40:17 +0200 Subject: [PATCH 3/4] Test latest pre-release of TestCommon --- .../dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj | 2 +- source/dotnet/wholesale-api/Test.Core/Test.Core.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj index 6777606897..eb8edc1252 100644 --- a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj +++ b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj @@ -6,7 +6,7 @@ true - + all diff --git a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj index 2d0af81a04..60cebd51b8 100644 --- a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj +++ b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj @@ -19,8 +19,8 @@ limitations under the License. Energinet.DataHub.Wholesale.Test.Core - - + + all From e0d1c68bfff9bec4a98f57bc2b9f5a34423a9f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Stenr=C3=B8jl?= Date: Wed, 2 Oct 2024 13:07:19 +0200 Subject: [PATCH 4/4] Use TestCommon release v7 --- .../dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj | 2 +- source/dotnet/wholesale-api/Test.Core/Test.Core.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj index eb8edc1252..fb90a277be 100644 --- a/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj +++ b/source/dotnet/wholesale-api/Edi.UnitTests/Edi.UnitTests.csproj @@ -6,7 +6,7 @@ true - + all diff --git a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj index 60cebd51b8..9b6cb0613f 100644 --- a/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj +++ b/source/dotnet/wholesale-api/Test.Core/Test.Core.csproj @@ -19,8 +19,8 @@ limitations under the License. Energinet.DataHub.Wholesale.Test.Core - - + + all