Skip to content

Commit 390db84

Browse files
fix: GetMe test
1 parent 0707796 commit 390db84

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

pkg/account/api/admin_account_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestGetMeMySQL(t *testing.T) {
5858
require.NoError(t, err)
5959
return st.Err()
6060
}
61-
org := environmentproto.Organization{Id: "org0"}
61+
org := environmentproto.Organization{Id: "org0", PasswordAuthenticationEnabled: true}
6262

6363
patterns := []struct {
6464
desc string
@@ -275,6 +275,9 @@ func TestGetMeMySQL(t *testing.T) {
275275
s.credentialsStorage.(*authstoragemock.MockCredentialsStorage).EXPECT().GetCredentials(
276276
gomock.Any(), "bucketeer@example.com",
277277
).Return(nil, authstorage.ErrCredentialsNotFound)
278+
s.credentialsStorage.(*authstoragemock.MockCredentialsStorage).EXPECT().CreateCredentials(
279+
gomock.Any(), "bucketeer@example.com", "",
280+
).Return(nil)
278281
},
279282
input: &accountproto.GetMeRequest{
280283
OrganizationId: "org0",

pkg/domainevent/domain/message.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,14 @@ func LocalizedMessage(eventType proto.Event_Type, localizer locale.Localizer) *p
13801380
localizer.MustLocalizeWithTemplate(locale.Organization),
13811381
),
13821382
}
1383+
case proto.Event_ORGANIZATION_PASSWORD_AUTHENTICATION_CHANGED:
1384+
return &proto.LocalizedMessage{
1385+
Locale: localizer.GetLocale(),
1386+
Message: localizer.MustLocalizeWithTemplate(
1387+
locale.ChangedTemplate,
1388+
localizer.MustLocalizeWithTemplate(locale.Organization),
1389+
),
1390+
}
13831391
case proto.Event_ORGANIZATION_UPDATED:
13841392
return &proto.LocalizedMessage{
13851393
Locale: localizer.GetLocale(),

0 commit comments

Comments
 (0)