ListBucketOptions extends BaseHttpRequestOptions implements Cloneable { public ListBucketOptions withPrefix(String prefix) { queryParameters.put("prefix", checkNotNull(prefix, "prefix")); 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 testPrefix() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("test"); assertEquals(options.buildQueryParameters().get(S3Constants.PREFIX), ImmutableList.of("test")); }
@Test public void testOneOptionQueryString() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("test"); Multimap<String, String> map = options.buildQueryParameters(); assertEquals(map.size(), 1); assertEquals(map.get("prefix"), ImmutableList.of("test")); }
@Test public void testPrefixStatic() { ListBucketOptions options = withPrefix("test"); assertEquals(options.buildQueryParameters().get(S3Constants.PREFIX), ImmutableList.of("test")); }
@Test(expectedExceptions = NullPointerException.class) public void testPrefixNPE() { withPrefix(null); }