- Added configuration options for Stalwart hosted mail in .env.example. - Updated Docker Compose to include Stalwart service with health checks. - Introduced new API endpoints for managing mail domains and migration projects. - Enhanced Authentik blueprints for user enrollment and post-migration security. - Updated OAuth handling for Google and Microsoft migration processes. - Improved error handling and response structures in the mail API. - Added integration tests for email claiming and migration workflows.
31 lines
716 B
Go
31 lines
716 B
Go
package migration
|
|
|
|
import "testing"
|
|
|
|
func TestIsGmailHistoryNotFound(t *testing.T) {
|
|
if !isGmailHistoryNotFound(fmtError("gmail api 404 Not Found: historyId")) {
|
|
t.Fatal("expected history 404")
|
|
}
|
|
if isGmailHistoryNotFound(fmtError("gmail api 403 Forbidden")) {
|
|
t.Fatal("403 is not history not found")
|
|
}
|
|
}
|
|
|
|
func fmtError(msg string) error {
|
|
return &simpleError{msg: msg}
|
|
}
|
|
|
|
type simpleError struct{ msg string }
|
|
|
|
func (e *simpleError) Error() string { return e.msg }
|
|
|
|
func TestGraphMessageRemoved(t *testing.T) {
|
|
removed := struct {
|
|
Reason string `json:"reason"`
|
|
}{Reason: "deleted"}
|
|
msg := graphMessage{ID: "msg-1", Removed: &removed}
|
|
if msg.Removed == nil {
|
|
t.Fatal("expected removed marker")
|
|
}
|
|
}
|