(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestEvent_CloudEvent_NilOrigin(t *testing.T) { |
| 78 | ctx, _ := NewContext(Context{Context: context.Background()}) // module will be nil by default |
| 79 | event, err := NewEvent(ctx, "started", nil) |
| 80 | if err != nil { |
| 81 | t.Fatalf("NewEvent() error = %v", err) |
| 82 | } |
| 83 | |
| 84 | // This should not panic |
| 85 | ce := event.CloudEvent() |
| 86 | |
| 87 | if ce.Source != "caddy" { |
| 88 | t.Errorf("Expected CloudEvent Source to be 'caddy', got '%s'", ce.Source) |
| 89 | } |
| 90 | if ce.Type != "started" { |
| 91 | t.Errorf("Expected CloudEvent Type to be 'started', got '%s'", ce.Type) |
| 92 | } |
| 93 | } |
nothing calls this directly
no test coverage detected