ListBucketOptions extends BaseHttpRequestOptions implements Cloneable { public ListBucketOptions maxResults(int maxKeys) { checkState(maxKeys >= 0, "maxKeys must be >= 0"); queryParameters.put("max-keys", Long.toString(maxKeys)); return this; }  ListBucketOptions withPrefix(String prefix); String getPrefix(); ListBucketOptions afterMarker(String marker); String getMarker(); ListBucketOptions maxResults(int maxKeys); Integer getMaxResults(); ListBucketOptions delimiter(String delimiter); String getDelimiter(); @Override ListBucketOptions clone(); static final ListBucketOptions NONE; }
@Test public void testMaxKeys() { ListBucketOptions options = new ListBucketOptions(); options.maxResults(1000); assertEquals(options.buildQueryParameters().get(S3Constants.MAX_KEYS), ImmutableList.of("1000")); }
@Test public void testMaxKeysStatic() { ListBucketOptions options = maxResults(1000); assertEquals(options.buildQueryParameters().get(S3Constants.MAX_KEYS), ImmutableList.of("1000")); }
@Test(expectedExceptions = IllegalStateException.class) public void testMaxKeysNegative() { maxResults(-1); }