Skip to content

Commit d079d45

Browse files
committed
chore: correct build on JDK 16+
1 parent a127525 commit d079d45

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

consumer/groovy/src/test/groovy/au/com/dius/pact/consumer/groovy/PactBodyBuilderSpec.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ class PactBodyBuilderSpec extends Specification {
222222
'$.orders[*].lineItems[*].productCodes': new MatchingRuleGroup([TypeMatcher.INSTANCE]),
223223
'$.orders[*].lineItems[*].productCodes[*].code': new MatchingRuleGroup([TypeMatcher.INSTANCE])
224224
]
225-
body.orders.size == 2
225+
body.orders.size() == 2
226226
body.orders.every { it.keySet() == ['id', 'lineItems'] as Set }
227-
body.orders.first().lineItems.size == 3
227+
body.orders.first().lineItems.size() == 3
228228
body.orders.first().lineItems.every { it.keySet() == ['id', 'amount', 'productCodes'] as Set }
229-
body.orders.first().lineItems.first().productCodes.size == 4
229+
body.orders.first().lineItems.first().productCodes.size() == 4
230230
body.orders.first().lineItems.first().productCodes.every { it.keySet() == ['code'] as Set }
231231
}
232232

@@ -292,9 +292,9 @@ class PactBodyBuilderSpec extends Specification {
292292
'$.permissions3': new MatchingRuleGroup([new MaxTypeMatcher(4)]),
293293
'$.permissions3[*]': new MatchingRuleGroup([new RegexMatcher('\\d+')])
294294
]
295-
body.permissions.size == 3
296-
body.permissions2.size == 3
297-
body.permissions3.size == 3
295+
body.permissions.size() == 3
296+
body.permissions2.size() == 3
297+
body.permissions3.size() == 3
298298
}
299299

300300
def 'pretty prints bodies by default'() {

consumer/src/test/groovy/au/com/dius/pact/consumer/PactDslJsonArrayMatcherSpec.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
124124
def result = new JsonSlurper().parseText(subject.body.toString())
125125

126126
then:
127-
result.size == 3
127+
result.size() == 3
128128
result.every { it.keySet() == ['defDate', 'cost'] as Set }
129129
}
130130

@@ -139,7 +139,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
139139
def result = new JsonSlurper().parseText(subject.body.toString())
140140

141141
then:
142-
result.size == 3
142+
result.size() == 3
143143
result.every { it.keySet() == ['defDate', 'cost'] as Set }
144144
}
145145

@@ -154,7 +154,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
154154
def result = new JsonSlurper().parseText(subject.body.toString())
155155

156156
then:
157-
result.size == 3
157+
result.size() == 3
158158
result.every { it.keySet() == ['defDate', 'cost'] as Set }
159159
}
160160

@@ -171,7 +171,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
171171
def result = new JsonSlurper().parseText(subject.body.toString())
172172

173173
then:
174-
result.first().size == 2
174+
result.first().size() == 2
175175
result.first().every { it.keySet() == ['defDate', 'cost'] as Set }
176176
}
177177

@@ -188,7 +188,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
188188
def result = new JsonSlurper().parseText(subject.body.toString())
189189

190190
then:
191-
result.first().size == 2
191+
result.first().size() == 2
192192
result.first().every { it.keySet() == ['defDate', 'cost'] as Set }
193193
}
194194

@@ -205,7 +205,7 @@ class PactDslJsonArrayMatcherSpec extends Specification {
205205
def result = new JsonSlurper().parseText(subject.body.toString())
206206

207207
then:
208-
result.first().size == 2
208+
result.first().size() == 2
209209
result.first().every { it.keySet() == ['defDate', 'cost'] as Set }
210210
}
211211

consumer/src/test/groovy/au/com/dius/pact/consumer/PactDslJsonContentMatcherSpec.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class PactDslJsonContentMatcherSpec extends Specification {
6060
def result = new JsonSlurper().parseText(subject.body.toString())
6161

6262
then:
63-
result.data.size == 2
63+
result.data.size() == 2
6464
result.data.every { it.keySet() == ['defDate', 'cost'] as Set }
6565
}
6666

@@ -77,7 +77,7 @@ class PactDslJsonContentMatcherSpec extends Specification {
7777
def result = new JsonSlurper().parseText(subject.body.toString())
7878

7979
then:
80-
result.data.size == 2
80+
result.data.size() == 2
8181
result.data.every { it.keySet() == ['defDate', 'cost'] as Set }
8282
}
8383

@@ -94,7 +94,7 @@ class PactDslJsonContentMatcherSpec extends Specification {
9494
def result = new JsonSlurper().parseText(subject.body.toString())
9595

9696
then:
97-
result.data.size == 2
97+
result.data.size() == 2
9898
result.data.every { it.keySet() == ['defDate', 'cost'] as Set }
9999
}
100100

core/model/src/test/groovy/au/com/dius/pact/core/model/V3PactSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class V3PactSpec extends Specification {
4242
def json = pactFile.withReader { Json.INSTANCE.toMap(JsonParser.INSTANCE.parseReader(it)) }
4343

4444
then:
45-
json.messages.size == 2
45+
json.messages.size() == 2
4646
json.messages*.description.toSet() == ['a hello message', 'a new hello message'].toSet()
4747
}
4848

@@ -76,7 +76,7 @@ class V3PactSpec extends Specification {
7676
def json = pactFile.withReader { Json.INSTANCE.toMap(JsonParser.INSTANCE.parseReader(it)) }
7777

7878
then:
79-
json.messages.size == 3
79+
json.messages.size() == 3
8080
json.messages*.description.toSet() == ['a hello message', 'a new hello message'].toSet()
8181
json.messages.find { it.description == 'a hello message' && !it.providerStates } ==
8282
[contents: 'Hello', description: 'a hello message', metaData: [ contentType: 'application/json' ]]

pact-publish/src/test/groovy/broker/PactBrokerClientPactSpec.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ class PactBrokerClientPactSpec extends Specification {
919919
new ConsumerVersionSelector('test', true, null, null)
920920
], [], '', false, '')
921921
assert consumerPacts instanceof Ok
922-
assert consumerPacts.value.size == 2
922+
assert consumerPacts.value.size() == 2
923923
assert !consumerPacts.value[0].pending
924924
assert !consumerPacts.value[1].pending
925925
}
@@ -1033,7 +1033,7 @@ class PactBrokerClientPactSpec extends Specification {
10331033
new ConsumerVersionSelector('test', true, null, null)
10341034
], ['tag'], 'master', true, '')
10351035
assert consumerPacts instanceof Ok
1036-
assert consumerPacts.value.size == 2
1036+
assert consumerPacts.value.size() == 2
10371037
assert !consumerPacts.value[0].pending
10381038
assert consumerPacts.value[1].pending
10391039
}
@@ -1158,7 +1158,7 @@ class PactBrokerClientPactSpec extends Specification {
11581158
new ConsumerVersionSelector('test', true, null, null)
11591159
], ['tag'], 'master', true, '2020-06-24')
11601160
assert consumerPacts instanceof Ok
1161-
assert consumerPacts.value.size == 2
1161+
assert consumerPacts.value.size() == 2
11621162
assert !consumerPacts.value[0].wip
11631163
assert consumerPacts.value[1].wip
11641164
}

provider/src/test/groovy/au/com/dius/pact/provider/ProviderInfoSpec.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ProviderInfoSpec extends Specification {
8080
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, [], '', false, '') >> new Ok([
8181
new PactBrokerResult('consumer', '', url, [], [], false, null, false, false, null)
8282
])
83-
result.size == 1
83+
result.size() == 1
8484
result[0].name == 'consumer'
8585
!result[0].pending
8686
}
@@ -103,7 +103,7 @@ class ProviderInfoSpec extends Specification {
103103
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, ['master'], '', true, '') >> new Ok([
104104
new PactBrokerResult('consumer', '', url, [], [], true, null, false, false, null)
105105
])
106-
result.size == 1
106+
result.size() == 1
107107
result[0].name == 'consumer'
108108
result[0].pending
109109
}
@@ -126,7 +126,7 @@ class ProviderInfoSpec extends Specification {
126126
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, [], 'master', true, '') >> new Ok([
127127
new PactBrokerResult('consumer', '', url, [], [], true, null, false, false, null)
128128
])
129-
result.size == 1
129+
result.size() == 1
130130
result[0].name == 'consumer'
131131
result[0].pending
132132
}
@@ -168,7 +168,7 @@ class ProviderInfoSpec extends Specification {
168168
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, ['master'], '', true, '') >> new Ok([
169169
new PactBrokerResult('consumer', '', url, [], [], false, null, false, false, null)
170170
])
171-
result.size == 1
171+
result.size() == 1
172172
result[0].name == 'consumer'
173173
!result[0].pending
174174
}
@@ -192,7 +192,7 @@ class ProviderInfoSpec extends Specification {
192192
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, ['master'], '', true, '2020-05-23') >> new Ok([
193193
new PactBrokerResult('consumer', '', url, [], [], true, null, true, false, null)
194194
])
195-
result.size == 1
195+
result.size() == 1
196196
result[0].name == 'consumer'
197197
result[0].pending
198198
}
@@ -214,7 +214,7 @@ class ProviderInfoSpec extends Specification {
214214
pactBrokerClient.fetchConsumersWithSelectorsV2('TestProvider', selectors, [], '', false, '') >> new Ok([
215215
new PactBrokerResult('consumer', '', url, [], [], true, null, true, false, null)
216216
])
217-
result.size == 1
217+
result.size() == 1
218218
result[0].name == 'consumer'
219219
result[0].pending
220220
}

provider/src/test/groovy/au/com/dius/pact/provider/VerificationResultSpec.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class VerificationResultSpec extends Specification {
5252

5353
then:
5454
result instanceof TestResult.Failed
55-
result.results.size == 1
55+
result.results.size() == 1
5656
result.results[0].interactionId == '1234ABCD'
5757
result.results[0].exception.message == 'Boom'
5858
result.results[0].description == 'Request to provider method failed with an exception'
@@ -71,7 +71,7 @@ class VerificationResultSpec extends Specification {
7171

7272
then:
7373
result instanceof TestResult.Failed
74-
result.results.size == 1
74+
result.results.size() == 1
7575
result.results[0].interactionId == '1234ABCD'
7676
result.results[0].exception instanceof RuntimeException
7777
result.results[0].exception.message == 'Boom'
@@ -107,7 +107,7 @@ class VerificationResultSpec extends Specification {
107107

108108
then:
109109
result instanceof TestResult.Failed
110-
result.results.size == 3
110+
result.results.size() == 3
111111
result.results[0].interactionId == '1234ABCD'
112112
result.results[0].attribute == 'status'
113113
result.results[0].description == 'expected status of 200 but was 404'

provider/src/test/groovy/au/com/dius/pact/provider/reporters/JsonReporterSpec.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class JsonReporterSpec extends Specification {
6767
then:
6868
reportDir.list().sort() as List == ['provider1.json']
6969
reportJson.provider.name == 'provider1'
70-
reportJson.execution.size == 2
70+
reportJson.execution.size() == 2
7171
reportJson.execution*.interactions*.interaction.description == [['Interaction 1'], ['Interaction 2']]
7272
}
7373

@@ -106,7 +106,7 @@ class JsonReporterSpec extends Specification {
106106
then:
107107
reportDir.list().sort() as List == ['provider1.json']
108108
reportJson.provider.name == 'provider1'
109-
reportJson.execution.size == 1
109+
reportJson.execution.size() == 1
110110
reportJson.execution.first().interactions.first().interaction.description == 'Interaction 1'
111111
}
112112

@@ -177,8 +177,8 @@ class JsonReporterSpec extends Specification {
177177

178178
then:
179179
reportJson.provider.name == 'provider1'
180-
reportJson.execution.size == 1
181-
reportJson.execution[0].interactions.size == 1
180+
reportJson.execution.size() == 1
181+
reportJson.execution[0].interactions.size() == 1
182182
reportJson.execution[0].interactions[0].verification.result == 'failed'
183183
reportJson.execution[0].interactions[0].verification.status == ['expected status of 201 but was 200']
184184
reportJson.execution[0].interactions[0].verification.header == ['HEADER-X': ["Expected a header 'HEADER-X' but was missing"]]
@@ -205,11 +205,11 @@ class JsonReporterSpec extends Specification {
205205
def reportJson = new JsonSlurper().parse(new File(reportDir, 'provider1.json'))
206206

207207
then:
208-
reportJson.execution.size == 1
209-
reportJson.execution[0].interactions.size == 1
208+
reportJson.execution.size() == 1
209+
reportJson.execution[0].interactions.size() == 1
210210
reportJson.execution[0].interactions[0].verification.result == 'failed'
211211
reportJson.execution[0].interactions[0].verification.exception.message == 'xxxx'
212-
reportJson.execution[0].interactions[0].verification.exception.stackTrace.size > 1
212+
reportJson.execution[0].interactions[0].verification.exception.stackTrace.size() > 1
213213
reportJson.execution[0].interactions[0].verification.exception.stackTrace[0] == 'java.lang.Exception: xxxx'
214214
}
215215
}

0 commit comments

Comments
 (0)