Skip to content

Commit

Permalink
Generate factory test content
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
afrittoli committed Mar 28, 2023
1 parent e3a7456 commit 6348ad3
Show file tree
Hide file tree
Showing 46 changed files with 795 additions and 771 deletions.
6 changes: 5 additions & 1 deletion pkg/api/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ func TestExamples(t *testing.T) {
if !ok {
t.Fatalf("missing produced event for event type: %v", name)
}
// Check that the produced event is valid
err := Validate(produced)
if err != nil {
t.Errorf("produced event failed to validate: %v", err)
}
consumed, err := NewFromJsonBytes(exampleConsumed)
if err != nil {
t.Fatalf("didn't expected it to fail, but it did: %v", err)
Expand All @@ -343,7 +348,6 @@ func TestExamples(t *testing.T) {
if d := cmp.Diff(consumed.GetSubject(), produced.GetSubject()); d != "" {
t.Errorf("args: diff(-want,+got):\n%s", d)
}

})
}
}
Loading

0 comments on commit 6348ad3

Please sign in to comment.