Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
james-hollinger committed Jun 24, 2024
2 parents b335cd3 + c89e640 commit 57c1d71
Show file tree
Hide file tree
Showing 235 changed files with 13,114 additions and 2,538 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/zap-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
fi
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.7.0
uses: zaproxy/action-full-scan@v0.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
docker_name: "owasp/zap2docker-stable"
docker_name: 'ghcr.io/zaproxy/zaproxy:stable'
issue_title: "ZAP Scan Report"
fail_action: false
target: ${{ env.ZAP_URL }}
Expand Down
12 changes: 6 additions & 6 deletions backend/pidp-backend.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pidp", "webapi\pidp.csproj", "{690CB0B5-518B-443E-9E5C-B5A63A3F9E13}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "pidp", "webapi\pidp.csproj", "{690CB0B5-518B-443E-9E5C-B5A63A3F9E13}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pidp.tests", "webapi.tests\pidp.tests.csproj", "{BC7BAF1F-4C48-4DB2-A704-EBB4DD2CFBFA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "pidp.tests", "webapi.tests\pidp.tests.csproj", "{BC7BAF1F-4C48-4DB2-A704-EBB4DD2CFBFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plr-intake", "services.plr-intake\plr-intake.csproj", "{8682A94E-4E90-4846-A7E8-E4CECB55DF79}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plr-intake.tests", "services.plr-intake.tests\plr-intake.tests.csproj", "{6C64ACF9-73DD-4A52-926E-9AFC07555060}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "endorsement-reminder", "services.endorsement-reminder\endorsement-reminder.csproj", "{BBEAD4F7-BD9E-43F9-8AAD-D11FE22451E0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "endorsement-reminder", "services.endorsement-reminder\endorsement-reminder.csproj", "{BBEAD4F7-BD9E-43F9-8AAD-D11FE22451E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "endorsement-reminder.tests", "services.endorsement-reminder.tests\endorsement-reminder.tests.csproj", "{1251BD7F-30CB-4333-87D3-A96912F86361}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "endorsement-reminder.tests", "services.endorsement-reminder.tests\endorsement-reminder.tests.csproj", "{1251BD7F-30CB-4333-87D3-A96912F86361}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "do-work", "tools.do-work\do-work.csproj", "{631ECF6D-6E61-49EF-933B-B9423A068032}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "do-work", "tools.do-work\do-work.csproj", "{631ECF6D-6E61-49EF-933B-B9423A068032}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<RootNamespace>EndorsementReminderTests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="XunitXml.TestLogger" Version="3.0.70" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="FakeItEasy" Version="8.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NodaTime" Version="3.1.11" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageReference Include="XunitXml.TestLogger" Version="3.1.20" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\services.endorsement-reminder\endorsement-reminder.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions backend/services.endorsement-reminder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine as build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine as build-env
WORKDIR /source

ENV DOTNET_CLI_HOME="/opt"
Expand All @@ -10,7 +10,7 @@ COPY ../webapi ./webapi
RUN dotnet publish services.endorsement-reminder/endorsement-reminder.csproj -c Release -o /app -r linux-musl-x64 --self-contained false

#----------------------------------------------------------------#
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
WORKDIR /app

COPY --from=build-env /app .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>EndorsementReminder</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -12,6 +11,6 @@
<ProjectReference Include="..\webapi\pidp.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="NodaTime" Version="3.1.11" />
</ItemGroup>
</Project>
6 changes: 2 additions & 4 deletions backend/tools.do-work/do-work.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>DoWork</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -15,5 +14,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion backend/tools.plr-test-data/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/net6.0/plr-test-data.dll",
"program": "${workspaceFolder}/bin/Debug/net8.0/plr-test-data.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
Expand Down
5 changes: 2 additions & 3 deletions backend/tools.plr-test-data/plr-test-data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>PlrTestData</RootNamespace>

<PackAsTool>true</PackAsTool>
<ToolCommandName>plr-test-data</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\services.plr-intake\plr-intake.csproj" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion backend/webapi.tests/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/net6.0/pidp.tests.dll",
"program": "${workspaceFolder}/bin/Debug/net8.0/pidp.tests.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ namespace PidpTests.Features.Parties;

using PidpTests.TestingExtensions;

public class ProfileStatusPrimaryCareRosteringTests : ProfileStatusTest
public class ProfileStatusProvincialAttachmentSystemTests : ProfileStatusTest
{
[Theory]
[MemberData(nameof(PlrSuccessTestData))]
public async void HandleAsync_RosteringProviderRoleAuthorized_Incomplete(PlrStandingsDigest digest, PlrStandingsDigest aggregateDigest)
public async void HandleAsync_PasProviderRoleAuthorized_Incomplete(PlrStandingsDigest digest, PlrStandingsDigest aggregateDigest)
{
var party = this.TestDb.Has(AParty.WithLicenceDeclared());
this.TestDb.Has(new AccessRequest
Expand All @@ -39,9 +39,9 @@ public async void HandleAsync_RosteringProviderRoleAuthorized_Incomplete(PlrStan

var profile = await handler.HandleAsync(new Query { Id = party.Id, User = AMock.BcscUser() });

var rosteringSection = profile.Section<PrimaryCareRosteringSection>();
rosteringSection.AssertNoAlerts();
Assert.Equal(StatusCode.Incomplete, rosteringSection.StatusCode);
var pasSection = profile.Section<ProvincialAttachmentSystemSection>();
pasSection.AssertNoAlerts();
Assert.Equal(StatusCode.Complete, pasSection.StatusCode);
}

public static IEnumerable<object[]> PlrSuccessTestData()
Expand All @@ -55,7 +55,7 @@ public static IEnumerable<object[]> PlrSuccessTestData()

[Theory]
[MemberData(nameof(PlrFailureTestData))]
public async void HandleAsync_RosteringProviderRoleUnauthorized_Locked(PlrStandingsDigest digest, PlrStandingsDigest aggregateDigest)
public async void HandleAsync_PasProviderRoleUnauthorized_Locked(PlrStandingsDigest digest, PlrStandingsDigest aggregateDigest)
{
var party = this.TestDb.Has(AParty.WithLicenceDeclared());
var client = A.Fake<IPlrClient>()
Expand All @@ -64,9 +64,9 @@ public async void HandleAsync_RosteringProviderRoleUnauthorized_Locked(PlrStandi

var profile = await handler.HandleAsync(new Query { Id = party.Id, User = AMock.BcscUser() });

var rosteringSection = profile.Section<PrimaryCareRosteringSection>();
rosteringSection.AssertNoAlerts();
Assert.Equal(StatusCode.Locked, rosteringSection.StatusCode);
var pasSection = profile.Section<ProvincialAttachmentSystemSection>();
pasSection.AssertNoAlerts();
Assert.Equal(StatusCode.Incomplete, pasSection.StatusCode);
}

public static IEnumerable<object[]> PlrFailureTestData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public async void HandleAsync_NoProfile_LockedOrHidden(ClaimsPrincipal user)

var eforms = profile.Section<SAEformsSection>();
eforms.AssertNoAlerts();
var expected = user.GetIdentityProvider() == IdentityProviders.BCServicesCard
? StatusCode.Locked
: StatusCode.Hidden;
var expected = StatusCode.Locked;
Assert.Equal(expected, eforms.StatusCode);
Assert.False(eforms.IncorrectLicenceType);
}
Expand All @@ -49,9 +47,7 @@ public async void HandleAsync_Demographics_LockedOrHidden(ClaimsPrincipal user)

var eforms = profile.Section<SAEformsSection>();
eforms.AssertNoAlerts();
var expected = user.GetIdentityProvider() == IdentityProviders.BCServicesCard
? StatusCode.Locked
: StatusCode.Hidden;
var expected = StatusCode.Locked;
Assert.Equal(expected, eforms.StatusCode);
Assert.False(eforms.IncorrectLicenceType);
}
Expand Down
24 changes: 12 additions & 12 deletions backend/webapi.tests/pidp.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<RootNamespace>PidpTests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NodaTime" Version="3.1.6" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="XunitXml.TestLogger" Version="3.0.70" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="FakeItEasy" Version="8.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.5" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NodaTime" Version="3.1.11" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageReference Include="XunitXml.TestLogger" Version="3.1.20" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\webapi\pidp.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion backend/webapi/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net6.0/pidp.dll",
"program": "${workspaceFolder}/bin/Debug/net8.0/pidp.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
Expand Down
Loading

0 comments on commit 57c1d71

Please sign in to comment.