Skip to content

Commit 9acd5ff

Browse files
committed
Generate factory test content
Generate as much as possible of the factory test. Add some extra coverage for getters and setters in generated code. Signed-off-by: Andrea Frittoli <[email protected]>
1 parent e3a7456 commit 9acd5ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+795
-771
lines changed

pkg/api/examples_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ func TestExamples(t *testing.T) {
325325
if !ok {
326326
t.Fatalf("missing produced event for event type: %v", name)
327327
}
328+
// Check that the produced event is valid
329+
err := Validate(produced)
330+
if err != nil {
331+
t.Errorf("produced event failed to validate: %v", err)
332+
}
328333
consumed, err := NewFromJsonBytes(exampleConsumed)
329334
if err != nil {
330335
t.Fatalf("didn't expected it to fail, but it did: %v", err)
@@ -343,7 +348,6 @@ func TestExamples(t *testing.T) {
343348
if d := cmp.Diff(consumed.GetSubject(), produced.GetSubject()); d != "" {
344349
t.Errorf("args: diff(-want,+got):\n%s", d)
345350
}
346-
347351
})
348352
}
349353
}

0 commit comments

Comments
 (0)