Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2eb1cd1
.net 8 Upgrade, package upgrades
DanOwenUKHO Jan 20, 2025
d2b10c9
Remove Fluent assertions
DanOwenUKHO Jan 20, 2025
edcc8bb
Clean up some warnings
DanOwenUKHO Jan 20, 2025
98d57f1
Remove no longer required suppressions
DanOwenUKHO Jan 21, 2025
a56f626
Update pacakges in mock project
DanOwenUKHO Jan 21, 2025
2608f7d
Fix more warnings
DanOwenUKHO Jan 21, 2025
9204849
Remove unneeded suppressions
DanOwenUKHO Jan 22, 2025
c27c3e9
Remove further suppressions
DanOwenUKHO Jan 22, 2025
6abf144
Update identity client
DanOwenUKHO Jan 22, 2025
32976e4
Try remove Identity client
DanOwenUKHO Jan 22, 2025
baddfee
Remove redundant packages
DanOwenUKHO Jan 23, 2025
abb07df
Downgrade azure.identity as the latest version has a package that can…
DanOwenUKHO Jan 23, 2025
3363078
Re upgrade
DanOwenUKHO Jan 23, 2025
5c6ee0f
Revert
DanOwenUKHO Jan 23, 2025
5f142f8
Revert changes to suppressions
DanOwenUKHO Jan 23, 2025
03b85d3
Address nunit warnings
DanOwenUKHO Jan 23, 2025
ce27f4f
Revert change
DanOwenUKHO Jan 23, 2025
d9469e3
Fix tests
DanOwenUKHO Jan 23, 2025
3fd73c4
Set static methods to static
DanOwenUKHO Jan 23, 2025
71713a8
Change to connection string for app insights
DanOwenUKHO Jan 24, 2025
e2d6a7b
Add missing packages
DanOwenUKHO Jan 24, 2025
f59880f
Tidy up code
DanOwenUKHO Jan 24, 2025
ab7c9fc
Fix braces inside compiler statement
DanOwenUKHO Jan 24, 2025
9d83dca
Remove global.json and autopatchsdk
DanOwenUKHO Jan 27, 2025
1d4ce8a
Update references to net version
DanOwenUKHO Jan 27, 2025
cab45d5
Remove global.json for stryker
DanOwenUKHO Jan 27, 2025
4020bae
Remove references to global.json
DanOwenUKHO Jan 27, 2025
efff3b2
Add UseDotNet task to build-test-publish.yml for .NET SDK setup
DanOwenUKHO Jan 27, 2025
f4303ae
Update suppressions
DanOwenUKHO Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Deployment/src/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module "mock_webapp_service" {
"ASPNETCORE_ENVIRONMENT" = local.env_name
"WEBSITE_RUN_FROM_PACKAGE" = "1"
"WEBSITE_ENABLE_SYNC_UPDATE_SITE" = "true"
"APPINSIGHTS_INSTRUMENTATIONKEY" = "NOT_CONFIGURED"
}
tags = local.tags
allowed_ips = var.allowed_ips
Expand All @@ -74,7 +73,6 @@ module "webapp_service" {
"EventHubLoggingConfiguration:Environment" = local.env_name
"EventHubLoggingConfiguration:MinimumLoggingLevel" = "Warning"
"EventHubLoggingConfiguration:UkhoMinimumLoggingLevel" = "Information"
"APPINSIGHTS_INSTRUMENTATIONKEY" = module.app_insights.instrumentation_key
"ASPNETCORE_ENVIRONMENT" = local.env_name
"WEBSITE_RUN_FROM_PACKAGE" = "1"
"WEBSITE_ENABLE_SYNC_UPDATE_SITE" = "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public static IApplicationBuilder UseCorrelationIdMiddleware(this IApplicationBu
if (string.IsNullOrEmpty(correlationId))
{
correlationId = Guid.NewGuid().ToString();
context.Request.Headers.Add(XCorrelationIdHeaderKey, correlationId);
context.Request.Headers.Append(XCorrelationIdHeaderKey, correlationId);
}

context.Response.Headers.Add(XCorrelationIdHeaderKey, correlationId);
context.Response.Headers.Append(XCorrelationIdHeaderKey, correlationId);

await func();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand All @@ -13,9 +13,9 @@
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="6.0.36" />
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="8.0.12" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.2.0" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
Expand Down
14 changes: 7 additions & 7 deletions UKHO.PKSWireMockService.API/UKHO.PKSWireMock.API.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JsonConverter.Abstractions" Version="0.7.1" />
<PackageReference Include="JsonConverter.Newtonsoft.Json" Version="0.7.1" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="6.0.36" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="8.0.12" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="WireMock.Net" Version="1.6.10" />
<PackageReference Include="WireMock.Net.Abstractions" Version="1.6.10" />
<PackageReference Include="WireMock.Org.Abstractions" Version="1.6.10" />
<PackageReference Include="YamlDotNet" Version="15.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageReference Include="WireMock.Net" Version="1.6.11" />
<PackageReference Include="WireMock.Net.Abstractions" Version="1.6.11" />
<PackageReference Include="WireMock.Org.Abstractions" Version="1.6.11" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -18,20 +18,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FakeItEasy" Version="8.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.5.0">
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -16,18 +16,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Elastic.Apm" Version="1.31.0" />
<PackageReference Include="Elastic.Apm.Azure.Storage" Version="1.31.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.9" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.1" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="UKHO.Logging.EventHubLogProvider" Version="1.24163.8" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using FluentAssertions;
using Microsoft.Extensions.Options;
using NUnit.Framework;
using UKHO.BESS.API.FunctionalTests.Helpers;
Expand All @@ -26,7 +25,7 @@ public void Setup()
{
azureBlobStorageClient = new AzureBlobStorageClient(config);
HttpResponseMessage apiResponse = Extensions.ConfigureFt(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.Identifiers);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}

//PBI 140039 : BESS BS - Dealing with ancillary files : Get ReadMe.txt from FSS based on config
Expand All @@ -40,19 +39,19 @@ public void Setup()
public async Task WhenIUploadAConfigWithCorrectDetails_ThenBespokeExchangeSetShouldBeDownloaded(string exchangeSetStandard, string type, string readMeSearchFilter, string batchId, string keyFileType)
{
HttpResponseMessage response = await BessUploadFileHelper.UploadConfigFile(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.ValidConfigPath, testConfiguration.sharedKeyConfig.Key, exchangeSetStandard, type, readMeSearchFilter, keyFileType);
response.StatusCode.Should().Be((HttpStatusCode)201);
Assert.That(response.StatusCode, Is.EqualTo((HttpStatusCode)201));
Extensions.WaitForDownloadExchangeSet();
var downloadFolderPath = await EssEndpointHelper.CreateExchangeSetFile(batchId, true, keyFileType, true);
var expectedResultReadme = FssBatchHelper.CheckReadMeInBessExchangeSet(downloadFolderPath, readMeSearchFilter);
expectedResultReadme.Should().Be(true);
Assert.That(expectedResultReadme);
var expectedResultSerial = FssBatchHelper.CheckInfoFolderAndSerialEncInBessExchangeSet(downloadFolderPath, type);
expectedResultSerial.Should().Be(true);
Assert.That(expectedResultSerial);
FssBatchHelper.VerifyCatalogContents(downloadFolderPath, readMeSearchFilter);
HttpResponseMessage expectedResult = await fssEndPointHelper.CheckBatchDetails(batchId);
await FssBatchHelper.VerifyBessBatchDetails(expectedResult);
string? batchFolderPath = Path.GetDirectoryName(downloadFolderPath);
bool expectedResulted = FssBatchHelper.VerifyPermitFile(batchFolderPath, keyFileType);
expectedResulted.Should().Be(true);
Assert.That(expectedResulted);
}

//PBI 147171: BESS BS - Handling of empty ES and Error.txt Scenarios
Expand All @@ -69,7 +68,7 @@ public async Task WhenIProcessSameConfigWithCorrectDetailsTwice_ThenEmptyExchang
FssBatchHelper.CheckFilesInEmptyBess(downloadFolderPath);
string? batchFolderPath = Path.GetDirectoryName(downloadFolderPath);
bool expectedResulted = FssBatchHelper.VerifyPermitFile(batchFolderPath, keyFileType);
expectedResulted.Should().Be(false);
Assert.That(!expectedResulted);
}

[TearDown]
Expand All @@ -90,7 +89,7 @@ public void OneTimeTearDown()
{
//cleaning up the stub home directory
HttpResponseMessage apiResponse = Extensions.Cleanup(testConfiguration.bessConfig.BaseUrl);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using FluentAssertions;
using NUnit.Framework;
using UKHO.BESS.API.FunctionalTests.Helpers;

Expand All @@ -14,7 +13,7 @@ public class RequestAndDownloadExchangeSet
public void SetupAsync()
{
HttpResponseMessage apiResponse = Extensions.ConfigureFt(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.Identifiers);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}

//PBI 150897: Testing : BESS BS - Request, wait/poll and download exchange set
Expand All @@ -31,7 +30,7 @@ public async Task WhenIAddAQueueMessageWithCorrectDetails_ThenExchangeSetShouldB
Extensions.WaitForDownloadExchangeSet();
string downloadFolderPath = await EssEndpointHelper.CreateExchangeSetFile(batchId);
bool expectedResulted = FssBatchHelper.CheckFilesInDownloadedZip(downloadFolderPath, exchangeSetStandard);
expectedResulted.Should().Be(true);
Assert.That(expectedResulted);
}

[TearDown]
Expand All @@ -49,7 +48,7 @@ public void OneTimeTearDown()
{
//cleaning up the stub home directory
HttpResponseMessage apiResponse = Extensions.Cleanup(testConfiguration.bessConfig.BaseUrl);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using FluentAssertions;
using NUnit.Framework;
using UKHO.BESS.API.FunctionalTests.Helpers;
using UKHO.BESS.API.FunctionalTests.Models;
Expand All @@ -10,55 +9,55 @@ public class EssIntegrationTests
{
static readonly TestConfiguration testConfiguration = new();
public DataHelper dataHelper = new();
protected List<string> productIdentifiers = new() { testConfiguration.authTokenConfig.ProductName! };
protected List<string> productIdentifiers = [testConfiguration.authTokenConfig.ProductName!];
private List<ProductVersionModel>? productVersionData { get; set; }

[OneTimeSetUp]
public void SetupAsync()
{
productVersionData = new List<ProductVersionModel>();
productVersionData = [];
HttpResponseMessage apiResponse = Extensions.ConfigureFt(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.Identifiers);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}

//Product Backlog Item 140038: BESS BS - AD auth for ESS and FSS API
[Test]
public async Task WhenICallEssProductIdentifierEndpoint_ThenSuccessStatusCode200IsReturned()
{
HttpResponseMessage apiResponse = await EssEndpointHelper.ProductIdentifiersEndpoint(testConfiguration.authTokenConfig.BaseUrl, productIdentifiers, testConfiguration.bessConfig.s57ExchangeSetStandard);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}

//Product Backlog Item 140038: BESS BS - AD auth for ESS and FSS API
[Test]
public async Task WhenICallEssProductIdentifierEndpointWithIncorrectURL_ThenBadRequestStatusCode400IsReturned()
{
HttpResponseMessage apiResponse = await EssEndpointHelper.ProductIdentifiersEndpoint(testConfiguration.authTokenConfig.BaseUrl, productIdentifiers, testConfiguration.bessConfig.s63ExchangeSetStandard, false);
apiResponse.StatusCode.Should().Be((HttpStatusCode)400);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)400));
}

//Product Backlog Item 140038: BESS BS - AD auth for ESS and FSS API
[Test]
public async Task WhenICallEssProductVersionEndpoint_ThenSuccessStatusCode200IsReturned()
{
productVersionData = new List<ProductVersionModel> {
productVersionData = [
dataHelper.GetProductVersionData(testConfiguration.authTokenConfig.ProductName, testConfiguration.authTokenConfig.EditionNumber, testConfiguration.authTokenConfig.UpdateNumber)
};
];

HttpResponseMessage apiResponse = await EssEndpointHelper.ProductVersionsEndpoint(testConfiguration.authTokenConfig.BaseUrl, productVersionData, testConfiguration.bessConfig.s57ExchangeSetStandard);
apiResponse.StatusCode.Should().Be((HttpStatusCode)200);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)200));
}

//Product Backlog Item 140038: BESS BS - AD auth for ESS and FSS API
[Test]
public async Task WhenICallEssProductVersionEndpointWithIncorrectURL_ThenBadRequestStatusCode400IsReturned()
{
productVersionData = new List<ProductVersionModel> {
productVersionData = [
dataHelper.GetProductVersionData(testConfiguration.authTokenConfig.ProductName, testConfiguration.authTokenConfig.EditionNumber, testConfiguration.authTokenConfig.UpdateNumber)
};
];

HttpResponseMessage apiResponse = await EssEndpointHelper.ProductVersionsEndpoint(testConfiguration.authTokenConfig.BaseUrl, productVersionData, testConfiguration.bessConfig.s63ExchangeSetStandard, false);
apiResponse.StatusCode.Should().Be((HttpStatusCode)400);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)400));
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using FluentAssertions;
using Microsoft.Extensions.Options;
using NUnit.Framework;
using UKHO.BESS.API.FunctionalTests.Helpers;
Expand All @@ -10,8 +9,8 @@ namespace UKHO.BESS.API.FunctionalTests.FunctionalTests.MockEndPoint
{
public class UploadBessConfigFileTests
{
static readonly TestConfiguration testConfiguration = new();
static BessStorageConfiguration bessStorageConfiguration = testConfiguration.bessStorageConfig;
private static readonly TestConfiguration testConfiguration = new();
private static readonly BessStorageConfiguration bessStorageConfiguration = testConfiguration.bessStorageConfig;
AzureBlobStorageClient? azureBlobStorageClient;
readonly dynamic config = Options.Create(new PeriodicOutputService.Common.Configuration.BessStorageConfiguration
{
Expand All @@ -30,15 +29,15 @@ public void Setup()
public async Task WhenICallUploadConfigApiWithValidConfigFile_ThenCreatedStatusCode201IsReturned()
{
HttpResponseMessage apiResponse = await BessUploadFileHelper.UploadConfigFile(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.ValidConfigPath, testConfiguration.sharedKeyConfig.Key, "s63", "UPDATE", "AVCS", "PERMIT_XML");
apiResponse.StatusCode.Should().Be((HttpStatusCode)201);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)201));
}

//PBI 142682: BESS CS : Create a mock endpoint to upload BESS configuration files to azure storage
[Test]
public async Task WhenICallUploadConfigApiWithInvalidConfigFile_ThenBadRequestStatusCode400IsReturned()
{
HttpResponseMessage apiResponse = await BessUploadFileHelper.UploadConfigFile(testConfiguration.bessConfig.BaseUrl, testConfiguration.bessConfig.InvalidConfigPath, testConfiguration.sharedKeyConfig.Key, "s63", "UPDATE", "AVCS", "PERMIT_XML");
apiResponse.StatusCode.Should().Be((HttpStatusCode)400);
Assert.That(apiResponse.StatusCode, Is.EqualTo((HttpStatusCode)400));
}

[TearDown]
Expand Down
Loading
Loading