Skip to content

Commit db8feb3

Browse files
committed
update for optional type
1 parent 2e5069c commit db8feb3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/integration/unified/event_verification.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ type sdamEvent struct {
8989

9090
TopologyDescriptionChangedEvent *struct {
9191
PreviousDescription *struct {
92-
Type string `bson:"type"`
92+
Type *string `bson:"type"`
9393
} `bson:"previousDescription"`
9494
NewDescription *struct {
95-
Type string `bson:"type"`
95+
Type *string `bson:"type"`
9696
} `bson:"newDescription"`
9797
} `bson:"topologyDescriptionChangedEvent"`
9898
TopologyOpeningEvent *struct{} `bson:"topologyOpeningEvent"`
@@ -615,11 +615,11 @@ func verifySDAMEvents(client *clientEntity, expectedEvents *expectedEvents) erro
615615
return newEventVerificationError(idx, client, "failed to get next description changed event: %v", err.Error())
616616
}
617617

618-
if want := evt.TopologyDescriptionChangedEvent.PreviousDescription; want != nil && want.Type != got.PreviousDescription.Kind {
619-
return newEventVerificationError(idx, client, "want previous description %v, got %v", want.Type, got.PreviousDescription.Kind)
618+
if want := evt.TopologyDescriptionChangedEvent.PreviousDescription; want != nil && want.Type != nil && *want.Type != got.PreviousDescription.Kind {
619+
return newEventVerificationError(idx, client, "want previous description %v, got %v", *want.Type, got.PreviousDescription.Kind)
620620
}
621-
if want := evt.TopologyDescriptionChangedEvent.NewDescription; want != nil && want.Type != got.NewDescription.Kind {
622-
return newEventVerificationError(idx, client, "want new description %v, got %v", want.Type, got.NewDescription.Kind)
621+
if want := evt.TopologyDescriptionChangedEvent.NewDescription; want != nil && want.Type != nil && *want.Type != got.NewDescription.Kind {
622+
return newEventVerificationError(idx, client, "want new description %v, got %v", *want.Type, got.NewDescription.Kind)
623623
}
624624
case evt.TopologyOpeningEvent != nil:
625625
if _, topening, err = getNextTopologyOpeningEvent(topening); err != nil {

0 commit comments

Comments
 (0)