fix: remove redundante names
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 37s

This commit is contained in:
2024-12-04 23:22:25 +01:00
parent 2d5f42bb28
commit a69e9537d2
15 changed files with 188 additions and 190 deletions

View File

@@ -45,7 +45,7 @@ func TestSignIn(t *testing.T) {
mockClock.EXPECT().Now().Return(time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC))
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
actualSession, err := underTest.SignIn(user.Email, "password")
assert.Nil(t, err)
@@ -76,7 +76,7 @@ func TestSignIn(t *testing.T) {
mockClock := mocks.NewMockClockService(t)
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
_, err := underTest.SignIn("test@test.de", "wrong password")
@@ -91,7 +91,7 @@ func TestSignIn(t *testing.T) {
mockClock := mocks.NewMockClockService(t)
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
_, err := underTest.SignIn("test", "test")
assert.Equal(t, ErrInvaidCredentials, err)
@@ -105,7 +105,7 @@ func TestSignIn(t *testing.T) {
mockClock := mocks.NewMockClockService(t)
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
_, err := underTest.SignIn("test", "test")
@@ -123,7 +123,7 @@ func TestSignUp(t *testing.T) {
mockClock := mocks.NewMockClockService(t)
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
_, err := underTest.SignUp("invalid email address", "SomeStrongPassword123!")
@@ -137,7 +137,7 @@ func TestSignUp(t *testing.T) {
mockClock := mocks.NewMockClockService(t)
mockMail := mocks.NewMockMailService(t)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
weakPasswords := []string{
"123!ab", // too short
@@ -165,7 +165,7 @@ func TestSignUp(t *testing.T) {
EmailVerified: false,
}
random := NewRandomServiceImpl()
random := NewRandomImpl()
salt, err := random.Bytes(16)
assert.Nil(t, err)
password := "SomeStrongPassword123!"
@@ -179,7 +179,7 @@ func TestSignUp(t *testing.T) {
mockAuthDb.EXPECT().InsertUser(db.NewUser(expected.Id, expected.Email, false, nil, false, GetHashPassword(password, salt), salt, createTime)).Return(nil)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
actual, err := underTest.SignUp(expected.Email, password)
@@ -200,7 +200,7 @@ func TestSignUp(t *testing.T) {
Email: "some@valid.email",
}
random := NewRandomServiceImpl()
random := NewRandomImpl()
salt, err := random.Bytes(16)
assert.Nil(t, err)
password := "SomeStrongPassword123!"
@@ -214,7 +214,7 @@ func TestSignUp(t *testing.T) {
mockAuthDb.EXPECT().InsertUser(db.NewUser(user.Id, user.Email, false, nil, false, GetHashPassword(password, salt), salt, createTime)).Return(db.ErrUserExists)
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
_, err = underTest.SignUp(user.Email, password)
assert.Equal(t, ErrAccountExists, err)
@@ -244,7 +244,7 @@ func TestSendVerificationMail(t *testing.T) {
return strings.Contains(message, token.Token)
})).Return()
underTest := NewAuthServiceImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.ServerSettings{})
underTest := NewAuthImpl(mockAuthDb, mockRandom, mockClock, mockMail, &types.Settings{})
underTest.SendVerificationMail(userId, email)
})