diff --git a/tests/imap_test.go b/tests/imap_test.go index 4165984f..8138a9c9 100644 --- a/tests/imap_test.go +++ b/tests/imap_test.go @@ -19,6 +19,7 @@ package tests import ( "bytes" + "encoding/base64" "encoding/json" "fmt" "io" @@ -118,8 +119,8 @@ func (s *scenario) imapClientCannotAuthenticateWithIncorrectUsername(clientID st func (s *scenario) imapClientCannotAuthenticateWithIncorrectPassword(clientID string) error { userID, client := s.t.getIMAPClient(clientID) - - if err := client.Login(s.t.getUserByID(userID).getEmails()[0], s.t.getUserByID(userID).getBridgePass()+"bad"); err == nil { + badPass := base64.StdEncoding.EncodeToString([]byte("bad_password")) + if err := client.Login(s.t.getUserByID(userID).getEmails()[0], badPass); err == nil { return fmt.Errorf("expected error, got nil") } diff --git a/tests/smtp_test.go b/tests/smtp_test.go index c5d48f66..4a986837 100644 --- a/tests/smtp_test.go +++ b/tests/smtp_test.go @@ -18,6 +18,7 @@ package tests import ( + "encoding/base64" "fmt" "net/smtp" "os" @@ -84,8 +85,8 @@ func (s *scenario) smtpClientCannotAuthenticateWithIncorrectUsername(clientID st func (s *scenario) smtpClientCannotAuthenticateWithIncorrectPassword(clientID string) error { userID, client := s.t.getSMTPClient(clientID) - - if err := client.Auth(smtp.PlainAuth("", s.t.getUserByID(userID).getEmails()[0], s.t.getUserByID(userID).getBridgePass()+"bad", constants.Host)); err == nil { + badPass := base64.StdEncoding.EncodeToString([]byte("bad_password")) + if err := client.Auth(smtp.PlainAuth("", s.t.getUserByID(userID).getEmails()[0], badPass, constants.Host)); err == nil { return fmt.Errorf("expected error, got nil") }