Skip to content

Commit 74d4a9d

Browse files
authored
Merge pull request #315 from suzuito/add-newbodymatcher
feat: add constractors for Body Matcher
2 parents 6488bde + 8478556 commit 74d4a9d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

server/types/matchers.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,19 @@ func (bm *BodyMatcher) UnmarshalYAML(unmarshal func(interface{}) error) error {
333333
bm.bodyJson = res
334334
return nil
335335
}
336+
337+
func NewJSONBodyMatcher(
338+
bodyJson map[string]StringMatcher,
339+
) *BodyMatcher {
340+
return &BodyMatcher{
341+
bodyJson: bodyJson,
342+
}
343+
}
344+
345+
func NewStringBodyMatcher(
346+
bodyString StringMatcher,
347+
) *BodyMatcher {
348+
return &BodyMatcher{
349+
bodyString: &bodyString,
350+
}
351+
}

0 commit comments

Comments
 (0)