Skip to content

Commit

Permalink
chore: fix codenarc issue #401
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Jan 17, 2023
1 parent 765bd61 commit 30611e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class DslSpec extends Specification {
def 'eachKeyMappedToAnArrayLike does not work on "nested" property'() {
given:
def body = new PactDslJsonBody()
.date("date", "yyyyMMdd'T'HHmmss")
.stringMatcher("system", ".+", "systemname")
.object("data")
.eachKeyMappedToAnArrayLike("subsystem_name")
.stringType("id","1234567")
.date('date', "yyyyMMdd'T'HHmmss")
.stringMatcher('system', '.+', 'systemname')
.object('data')
.eachKeyMappedToAnArrayLike('subsystem_name')
.stringType('id', '1234567')
.closeArray()
.closeObject()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import au.com.dius.pact.core.model.matchingrules.ContentTypeMatcher
import au.com.dius.pact.core.model.matchingrules.DateMatcher
import au.com.dius.pact.core.model.matchingrules.MatchingRuleCategory
import au.com.dius.pact.core.model.matchingrules.MatchingRulesImpl
import au.com.dius.pact.core.model.matchingrules.MinTypeMatcher
import au.com.dius.pact.core.model.matchingrules.RegexMatcher
import au.com.dius.pact.core.model.matchingrules.TypeMatcher
import au.com.dius.pact.core.model.matchingrules.ValuesMatcher
Expand Down Expand Up @@ -177,12 +176,12 @@ class MatchingSpec extends Specification {
result.mismatches.empty
}

@Issue("401")
@Issue('#401')
def 'Body Matching - eachKeyMappedToAnArrayLike does not work on "nested" property'() {
given:
bodyContext.matchers
.addRule('$.date', new DateMatcher("yyyyMMdd'T'HHmmss"))
.addRule('$.system', new RegexMatcher(".+"))
.addRule('$.system', new RegexMatcher('.+'))
.addRule('$.data', ValuesMatcher.INSTANCE)
.addRule('$.data.*[*].id', TypeMatcher.INSTANCE)

Expand Down

0 comments on commit 30611e6

Please sign in to comment.