- 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.
36 lines
991 B
Go
36 lines
991 B
Go
package migration
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestMigrationContactAndEventPaths(t *testing.T) {
|
|
book := "/remote.php/dav/addressbooks/user%40test.local/migration-import/"
|
|
contact := migrationContactPath(book, "google", "people/abc")
|
|
if contact != book+"google-people-abc@ultimail.migrated.vcf" {
|
|
t.Fatalf("contact path: %q", contact)
|
|
}
|
|
cal := "/remote.php/dav/calendars/user%40test.local/migration-import/"
|
|
event := migrationEventPath(cal, "microsoft", "cal1:evt1")
|
|
if event != cal+"microsoft-cal1:evt1@ultimail.migrated.ics" {
|
|
t.Fatalf("event path: %q", event)
|
|
}
|
|
}
|
|
|
|
func TestIsDeleteNotFound(t *testing.T) {
|
|
if isDeleteNotFound(nil) {
|
|
t.Fatal("nil is not not-found")
|
|
}
|
|
if !isDeleteNotFound(errors.New("delete failed: 404")) {
|
|
t.Fatal("expected 404 as not-found")
|
|
}
|
|
if !isDeleteNotFound(fmt.Errorf("not found")) {
|
|
t.Fatal("expected not found message")
|
|
}
|
|
if isDeleteNotFound(errors.New("permission denied")) {
|
|
t.Fatal("unexpected not-found")
|
|
}
|
|
}
|