@@ -169,18 +169,19 @@ class GridFSDownloadStreamSpecification extends Specification {
169169
170170 def ' should skip to the correct point' () {
171171 given :
172- def fileInfo = new GridFSFile (new BsonObjectId (new ObjectId ()), ' filename' , 60L , 25 , new Date (), ' abc' , new Document ())
172+ def fileInfo = new GridFSFile (new BsonObjectId (new ObjectId ()), ' filename' , 4194297L , 32 ,
173+ new Date (), ' abc' , new Document ())
173174
174- def firstChunkBytes = 1 .. 25 as byte []
175- def thirdChunkBytes = 51 .. 60 as byte []
175+ def firstChunkBytes = 1 .. 32 as byte []
176+ def lastChunkBytes = 33 .. 57 as byte []
176177
177178 def sort = new Document (' n' , 1 )
178179
179180 def findQueries = [new Document (' files_id' , fileInfo. getId()). append(' n' , new Document (' $gte' , 0 )),
180- new Document (' files_id' , fileInfo. getId()). append(' n' , new Document (' $gte' , 2 ))]
181+ new Document (' files_id' , fileInfo. getId()). append(' n' , new Document (' $gte' , 131071 ))]
181182 def chunkDocuments =
182183 [new Document (' files_id' , fileInfo. getId()). append(' n' , 0 ). append(' data' , new Binary (firstChunkBytes)),
183- new Document (' files_id' , fileInfo. getId()). append(' n' , 2 ). append(' data' , new Binary (thirdChunkBytes ))]
184+ new Document (' files_id' , fileInfo. getId()). append(' n' , 131071 ). append(' data' , new Binary (lastChunkBytes ))]
184185
185186 def mongoCursor = Mock (MongoCursor )
186187 def findIterable = Mock (FindIterable )
@@ -210,10 +211,10 @@ class GridFSDownloadStreamSpecification extends Specification {
210211 readByte == [16 , 17 , 18 , 19 , 20 ] as byte []
211212
212213 when :
213- skipResult = downloadStream. skip(35 )
214+ skipResult = downloadStream. skip(4194272 )
214215
215216 then :
216- skipResult == 35L
217+ skipResult == 4194272L
217218 0 * chunksCollection. find(_)
218219
219220 when :
@@ -228,7 +229,7 @@ class GridFSDownloadStreamSpecification extends Specification {
228229 1 * mongoCursor. next() >> chunkDocuments[1 ]
229230
230231 then :
231- readByte == [56 , 57 , 58 , 59 , 60 ] as byte []
232+ readByte == [53 , 54 , 55 , 56 , 57 ] as byte []
232233
233234 when :
234235 skipResult = downloadStream. skip(1 )
0 commit comments