-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into MLPAB-2599-apply-a-security-standard-aquasec…
- Loading branch information
Showing
80 changed files
with
788 additions
and
615 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
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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ import ( | |
"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/notify" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/page" | ||
|
@@ -157,6 +158,7 @@ func TestPostConfirmDontWantToBeAttorneyLoggedOut(t *testing.T) { | |
SignedAt: time.Now(), | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
Attorneys: lpadata.Attorneys{ | ||
TrustCorporation: lpadata.TrustCorporation{UID: trustCorporationUID, Name: "trusty"}, | ||
|
@@ -202,7 +204,7 @@ func TestPostConfirmDontWantToBeAttorneyLoggedOut(t *testing.T) { | |
EmailGreeting(lpa). | ||
Return("Dear donor") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(ctx, "[email protected]", "lpa-uid", notify.AttorneyOptedOutEmail{ | ||
SendActorEmail(ctx, localize.En, "[email protected]", "lpa-uid", notify.AttorneyOptedOutEmail{ | ||
Greeting: "Dear donor", | ||
AttorneyFullName: tc.attorneyFullName, | ||
DonorFullName: "a b c", | ||
|
@@ -357,7 +359,7 @@ func TestPostConfirmDontWantToBeAttorneyLoggedOutErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(expectedError) | ||
|
||
return client | ||
|
@@ -395,7 +397,7 @@ func TestPostConfirmDontWantToBeAttorneyLoggedOutErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(nil) | ||
|
||
return client | ||
|
@@ -443,7 +445,7 @@ func TestPostConfirmDontWantToBeAttorneyLoggedOutErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(nil) | ||
|
||
return client | ||
|
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ import ( | |
"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneydata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/notify" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/page" | ||
|
@@ -94,6 +95,7 @@ func TestPostConfirmDontWantToBeAttorney(t *testing.T) { | |
SignedAt: time.Now(), | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
Attorneys: lpadata.Attorneys{ | ||
Attorneys: []lpadata.Attorney{ | ||
|
@@ -120,7 +122,7 @@ func TestPostConfirmDontWantToBeAttorney(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(r.Context(), "[email protected]", "lpa-uid", notify.AttorneyOptedOutEmail{ | ||
SendActorEmail(r.Context(), localize.En, "[email protected]", "lpa-uid", notify.AttorneyOptedOutEmail{ | ||
Greeting: "Dear donor", | ||
AttorneyFullName: "d e f", | ||
DonorFullName: "a b c", | ||
|
@@ -184,7 +186,7 @@ func TestPostConfirmDontWantToBeAttorneyErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(expectedError) | ||
|
||
return client | ||
|
@@ -204,7 +206,7 @@ func TestPostConfirmDontWantToBeAttorneyErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(nil) | ||
|
||
return client | ||
|
@@ -232,7 +234,7 @@ func TestPostConfirmDontWantToBeAttorneyErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(nil) | ||
|
||
return client | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ import ( | |
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/dynamo" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/notify" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/page" | ||
|
@@ -149,6 +150,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOut(t *testing.T) { | |
WitnessedByCertificateProviderAt: time.Now(), | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
CertificateProvider: lpadata.CertificateProvider{ | ||
FirstNames: "d e", LastName: "f", | ||
|
@@ -179,7 +181,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOut(t *testing.T) { | |
LpaUID: "lpa-uid", | ||
SignedAt: time.Now(), | ||
WitnessedByCertificateProviderAt: time.Now(), | ||
Donor: lpadata.Donor{FirstNames: "a b", LastName: "c", Email: "[email protected]"}, | ||
Donor: lpadata.Donor{FirstNames: "a b", LastName: "c", Email: "[email protected]", ContactLanguagePreference: localize.En}, | ||
CertificateProvider: lpadata.CertificateProvider{ | ||
FirstNames: "d e", LastName: "f", | ||
}, | ||
|
@@ -203,6 +205,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOut(t *testing.T) { | |
LpaUID: "lpa-uid", | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
}, | ||
lpaStoreClient: func() *mockLpaStoreClient { return nil }, | ||
|
@@ -283,7 +286,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOut(t *testing.T) { | |
EmailGreeting(&tc.lpa). | ||
Return("Dear donor") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(ctx, "[email protected]", "lpa-uid", tc.email). | ||
SendActorEmail(ctx, localize.En, "[email protected]", "lpa-uid", tc.email). | ||
Return(nil) | ||
|
||
localizer := newMockLocalizer(t) | ||
|
@@ -530,7 +533,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOutErrors(t *testing.T) | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(nil) | ||
|
||
return client | ||
|
@@ -577,7 +580,7 @@ func TestPostConfirmDontWantToBeCertificateProviderLoggedOutErrors(t *testing.T) | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(expectedError) | ||
|
||
return client | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ import ( | |
"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/notify" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/page" | ||
|
@@ -113,6 +114,7 @@ func TestPostConfirmDontWantToBeCertificateProvider(t *testing.T) { | |
WitnessedByCertificateProviderAt: time.Now(), | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
CertificateProvider: lpadata.CertificateProvider{ | ||
FirstNames: "d e", LastName: "f", UID: uid, | ||
|
@@ -145,6 +147,7 @@ func TestPostConfirmDontWantToBeCertificateProvider(t *testing.T) { | |
WitnessedByCertificateProviderAt: time.Now(), | ||
Donor: lpadata.Donor{ | ||
FirstNames: "a b", LastName: "c", Email: "[email protected]", | ||
ContactLanguagePreference: localize.En, | ||
}, | ||
CertificateProvider: lpadata.CertificateProvider{ | ||
FirstNames: "d e", LastName: "f", UID: uid, | ||
|
@@ -167,7 +170,7 @@ func TestPostConfirmDontWantToBeCertificateProvider(t *testing.T) { | |
"not witnessed and signed": { | ||
lpa: lpadata.Lpa{ | ||
LpaUID: "lpa-uid", | ||
Donor: lpadata.Donor{FirstNames: "a b", LastName: "c", Email: "[email protected]"}, | ||
Donor: lpadata.Donor{FirstNames: "a b", LastName: "c", Email: "[email protected]", ContactLanguagePreference: localize.En}, | ||
}, | ||
lpaStoreClient: func() *mockLpaStoreClient { return nil }, | ||
donorStore: func() *mockDonorStore { | ||
|
@@ -241,7 +244,7 @@ func TestPostConfirmDontWantToBeCertificateProvider(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(r.Context(), "[email protected]", "lpa-uid", tc.email). | ||
SendActorEmail(r.Context(), localize.En, "[email protected]", "lpa-uid", tc.email). | ||
Return(nil) | ||
|
||
err := ConfirmDontWantToBeCertificateProvider(nil, lpaStoreResolvingService, tc.lpaStoreClient(), tc.donorStore(), certificateProviderStore, notifyClient, "example.com")(testAppData, w, r, nil) | ||
|
@@ -467,7 +470,7 @@ func TestPostConfirmDontWantToBeCertificateProviderErrors(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
client.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(expectedError) | ||
|
||
return client | ||
|
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ import ( | |
"github.com/ministryofjustice/opg-modernising-lpa/internal/certificateprovider/certificateproviderdata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/event" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/identity" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/localize" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore/lpadata" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/notify" | ||
"github.com/ministryofjustice/opg-modernising-lpa/internal/onelogin" | ||
|
@@ -205,7 +206,7 @@ func TestGetIdentityWithOneLoginCallbackWhenIdentityCheckFailed(t *testing.T) { | |
Return(&lpadata.Lpa{ | ||
LpaUID: "lpa-uid", | ||
CertificateProvider: lpadata.CertificateProvider{FirstNames: "a", LastName: "b"}, | ||
Donor: lpadata.Donor{Email: "[email protected]", FirstNames: "c", LastName: "d"}, | ||
Donor: lpadata.Donor{Email: "[email protected]", FirstNames: "c", LastName: "d", ContactLanguagePreference: localize.En}, | ||
Type: lpadata.LpaTypePersonalWelfare, | ||
SignedAt: time.Now(), | ||
WitnessedByCertificateProviderAt: time.Now(), | ||
|
@@ -239,7 +240,7 @@ func TestGetIdentityWithOneLoginCallbackWhenIdentityCheckFailed(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("Dear donor") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(r.Context(), "[email protected]", "lpa-uid", notify.CertificateProviderFailedIDCheckEmail{ | ||
SendActorEmail(r.Context(), localize.En, "[email protected]", "lpa-uid", notify.CertificateProviderFailedIdentityCheckEmail{ | ||
Greeting: "Dear donor", | ||
DonorFullName: "c d", | ||
CertificateProviderFullName: "a b", | ||
|
@@ -324,7 +325,7 @@ func TestGetIdentityWithOneLoginCallbackWhenSendingEmailError(t *testing.T) { | |
EmailGreeting(mock.Anything). | ||
Return("") | ||
notifyClient.EXPECT(). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). | ||
Return(expectedError) | ||
|
||
eventClient := newMockEventClient(t) | ||
|
Oops, something went wrong.