findify / s3mock

Embedded S3 server for easy mocking
MIT License
386 stars 107 forks source link

Use correct default maxkeys size to trigger expected pagination #157

Open LyndonArmitage opened 4 years ago

LyndonArmitage commented 4 years ago

Both the InMemoryProvider and FileProvider use Int.MaxValue as their default maxkeys value:

val count = maxkeys.getOrElse(Int.MaxValue)

This should be set to 1,000 as a default so it is similar to the real S3 API, otherwise you can run into situations when testing where the Mock API will return more items than a real API call would.

See documentation of AWS limit here: https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html