-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BFF basic fixes * FE fixes * Remove redundant function * Fix sonar lint analysis * More code coverage * FE basic fixes * More fixes * Fix for empty function warnings * Additional small fix * Split ReferenceDataController into multiple controllers * More fixes * Whitespace changes to trigger sonar checks * Comment to trigger sonar checks * Add ignore rule for method parameter count * Revert "Whitespace changes to trigger sonar checks" This reverts commit 9253160. * Revert "Comment to trigger sonar checks" This reverts commit 70cca0d.
- Loading branch information
1 parent
c6a411e
commit eea8e5d
Showing
191 changed files
with
1,110 additions
and
1,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
AdminWebsite/AdminWebsite.IntegrationTests/Helper/ApiUriFactory.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,18 @@ namespace AdminWebsite.Testing.Common.Builders | |
public class ClaimsPrincipalBuilder | ||
{ | ||
private const string Username = "[email protected]"; | ||
|
||
private readonly List<Claim> _claims; | ||
|
||
private static class ClaimTypeNames | ||
{ | ||
public const string PreferredUsername = "preferred_username"; | ||
} | ||
|
||
public ClaimsPrincipalBuilder() | ||
{ | ||
_claims = new List<Claim> | ||
{ | ||
new Claim("preferred_username", Username), | ||
new(ClaimTypeNames.PreferredUsername, Username), | ||
new Claim(ClaimTypes.NameIdentifier, "userId"), | ||
new Claim("name", "John Doe") | ||
}; | ||
|
@@ -26,9 +31,9 @@ public ClaimsPrincipalBuilder WithRole(string role) | |
|
||
public ClaimsPrincipalBuilder WithUsername(string username) | ||
{ | ||
var usernameClaimIndex = _claims.FindIndex(x => x.Type == "preferred_username"); | ||
var usernameClaimIndex = _claims.FindIndex(x => x.Type == ClaimTypeNames.PreferredUsername); | ||
_claims.RemoveAt(usernameClaimIndex); | ||
return WithClaim("preferred_username", username); | ||
return WithClaim(ClaimTypeNames.PreferredUsername, username); | ||
} | ||
|
||
public ClaimsPrincipalBuilder WithClaim(string claimType, string value) | ||
|
@@ -39,7 +44,7 @@ public ClaimsPrincipalBuilder WithClaim(string claimType, string value) | |
|
||
public ClaimsPrincipal Build() | ||
{ | ||
var identity = new ClaimsIdentity(_claims, "TestAuthType", "preferred_username", ClaimTypes.Role); | ||
var identity = new ClaimsIdentity(_claims, "TestAuthType", ClaimTypeNames.PreferredUsername, ClaimTypes.Role); | ||
var claimsPrincipal = new ClaimsPrincipal(identity); | ||
return claimsPrincipal; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,62 +89,6 @@ public async Task Should_book_hearing() | |
_mocker.Mock<IBookingsApiClient>().Verify(x => x.BookNewHearingWithCodeAsync(It.IsAny<BookNewHearingRequestV2>()), Times.Once); | ||
} | ||
|
||
private BookingDetailsRequest InitHearingForTest() | ||
{ | ||
// request with existing person, new user, existing user in AD but not in persons table | ||
var bookNewHearingRequest = new BookingDetailsRequest | ||
{ | ||
Participants = new List<AdminWebsite.Contracts.Requests.ParticipantRequest> | ||
{ | ||
new () | ||
{ | ||
CaseRoleName = "CaseRole", ContactEmail = "[email protected]", | ||
HearingRoleName = "HearingRole", DisplayName = "display name1", | ||
FirstName = "fname", MiddleNames = "", LastName = "lname1", Username = "[email protected]", | ||
OrganisationName = "", Representee = "", TelephoneNumber = "" | ||
}, | ||
new () | ||
{ | ||
CaseRoleName = "CaseRole", ContactEmail = "[email protected]", | ||
HearingRoleName = "HearingRole", DisplayName = "display name2", | ||
FirstName = "fname2", MiddleNames = "", LastName = "lname2", OrganisationName = "", | ||
Representee = "", TelephoneNumber = "", Username = "[email protected]" | ||
}, | ||
new () | ||
{ | ||
CaseRoleName = "CaseRole", ContactEmail = "[email protected]", | ||
HearingRoleName = "HearingRole", DisplayName = "display name3", | ||
FirstName = "fname3", MiddleNames = "", LastName = "lname3", OrganisationName = "", | ||
Representee = "", TelephoneNumber = "", Username = "[email protected]" | ||
}, | ||
new () | ||
{ | ||
CaseRoleName = "Panel Member", ContactEmail = "[email protected]", | ||
HearingRoleName = "HearingRole", DisplayName = "display name4", | ||
FirstName = "fname4", MiddleNames = "", LastName = "lname4", OrganisationName = "", | ||
Representee = "", TelephoneNumber = "", Username = "[email protected]" | ||
}, | ||
new () | ||
{ | ||
CaseRoleName = "Judge", ContactEmail = "[email protected]", | ||
HearingRoleName = "Judge", DisplayName = "Judge Fudge", | ||
FirstName = "Jack", MiddleNames = "", LastName = "Fudge", | ||
Username = "[email protected]", OrganisationName = "", Representee = "", | ||
TelephoneNumber = "" | ||
} | ||
}, | ||
Endpoints = new List<EndpointRequest> | ||
{ | ||
new () | ||
{DisplayName = "displayname1", DefenceAdvocateContactEmail = "[email protected]"}, | ||
new () | ||
{DisplayName = "displayname2", DefenceAdvocateContactEmail = "[email protected]"}, | ||
} | ||
}; | ||
|
||
return SetUpRequest(bookNewHearingRequest); | ||
} | ||
|
||
private BookingDetailsRequest InitHearingForV2Test() | ||
{ | ||
// request with existing person, new user, existing user in AD but not in persons table | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.