- 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.
27 lines
698 B
Go
27 lines
698 B
Go
package migration
|
|
|
|
import "testing"
|
|
|
|
func TestWorkerConfigDefaults(t *testing.T) {
|
|
w := NewWorker(nil, nil, nil, nil, nil, nil, nil, nil, "", WorkerConfig{})
|
|
if w.concurrency != 1 {
|
|
t.Fatalf("concurrency = %d", w.concurrency)
|
|
}
|
|
if w.jobLimit != 5 {
|
|
t.Fatalf("jobLimit = %d", w.jobLimit)
|
|
}
|
|
|
|
w = NewWorker(nil, nil, nil, nil, nil, nil, nil, nil, "", WorkerConfig{Concurrency: 4})
|
|
if w.concurrency != 4 {
|
|
t.Fatalf("concurrency = %d", w.concurrency)
|
|
}
|
|
if w.jobLimit != 12 {
|
|
t.Fatalf("jobLimit = %d", w.jobLimit)
|
|
}
|
|
|
|
w = NewWorker(nil, nil, nil, nil, nil, nil, nil, nil, "", WorkerConfig{Concurrency: 2, JobLimit: 8})
|
|
if w.jobLimit != 8 {
|
|
t.Fatalf("jobLimit = %d", w.jobLimit)
|
|
}
|
|
}
|