Skip to content

Commit

Permalink
fix: v3 provider state without parameters not correctly handled
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Oct 14, 2021
1 parent 8e15905 commit f857347
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion consumer/interaction_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ type InteractionV3 struct {

// Given specifies a provider state, may be called multiple times. Optional.
func (i *InteractionV3) Given(state models.ProviderStateV3) *InteractionV3 {
i.Interaction.interaction.GivenWithParameter(state.Name, state.Parameters)
if len(state.Parameters) == 0 {
i.Interaction.interaction.GivenWithParameter(state.Name, state.Parameters)
} else {
i.Interaction.interaction.Given(state.Name)
}

return i
}

0 comments on commit f857347

Please sign in to comment.