Skip to content

Commit d1fec61

Browse files
committed
Make tests work on Java 8
1 parent 8a6f9ab commit d1fec61

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

bson/src/test/unit/org/bson/codecs/IterableCodecSpecification.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ class IterableCodecSpecification extends Specification {
185185

186186
then:
187187
writer.getDocument() == new BsonDocument()
188-
.append('instants', new BsonArray(List.of(
189-
new BsonDocument('firstMap', new BsonArray(List.of(new BsonDateTime(1), new BsonDateTime(2)))),
190-
new BsonDocument('secondMap', new BsonArray(List.of(new BsonDateTime(3), new BsonDateTime(4)))))))
188+
.append('instants', new BsonArray(
189+
[
190+
new BsonDocument('firstMap', new BsonArray([new BsonDateTime(1), new BsonDateTime(2)])),
191+
new BsonDocument('secondMap', new BsonArray([new BsonDateTime(3), new BsonDateTime(4)]))
192+
]))
191193

192194
when:
193195
reader.readStartDocument()

bson/src/test/unit/org/bson/codecs/MapCodecSpecification.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ class MapCodecSpecification extends Specification {
249249
then:
250250
writer.getDocument() == new BsonDocument()
251251
.append('instants',
252-
new BsonDocument('firstMap', new BsonArray(List.of(new BsonDateTime(1), new BsonDateTime(2))))
253-
.append('secondMap', new BsonArray(List.of(new BsonDateTime(3), new BsonDateTime(4)))))
252+
new BsonDocument()
253+
.append('firstMap', new BsonArray([new BsonDateTime(1), new BsonDateTime(2)]))
254+
.append('secondMap', new BsonArray([new BsonDateTime(3), new BsonDateTime(4)])))
254255

255256
when:
256257
reader.readStartDocument()

0 commit comments

Comments
 (0)