Skip to content

Commit

Permalink
Fix some whitespace, simplify some test code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmoore committed Feb 21, 2017
1 parent 3036f40 commit 83f7779
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public final class ListBuckets extends StreamableRiakCommand.StreamableRiakComma
this.timeout = builder.timeout;
this.type = builder.type;

if (builder.allowListing == false)
if (!builder.allowListing)
{
throw new ListException();
}
Expand Down Expand Up @@ -196,7 +196,7 @@ public Builder(String type)
* </p>
* @return a reference to this object.
*/
public Builder withAllowListing()
public Builder withAllowListing()
{
this.allowListing = true;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public final class ListKeys extends StreamableRiakCommand.StreamableRiakCommandW
this.namespace = builder.namespace;
this.timeout = builder.timeout;

if (builder.allowListing == false)
if (!builder.allowListing)
{
throw new ListException();
}
Expand Down Expand Up @@ -193,7 +193,7 @@ public Builder(Namespace namespace)
* </p>
* @return a reference to this object.
*/
public Builder withAllowListing()
public Builder withAllowListing()
{
this.allowListing = true;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected BucketMapReduce(BucketInput input, Builder builder) throws ListExcepti
{
super(input, builder);

if (builder.allowListing == false)
if (!builder.allowListing)
{
throw new ListException();
}
Expand Down Expand Up @@ -48,7 +48,7 @@ protected Builder self()
* </p>
* @return a reference to this object.
*/
public Builder withAllowListing()
public Builder withAllowListing()
{
this.allowListing = true;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private ListKeys(ListKeys.Builder builder) throws ListException
this.tableName = builder.tableName;
this.timeout = builder.timeout;

if (builder.allowListing == false)
if (!builder.allowListing)
{
throw new ListException();
}
Expand Down Expand Up @@ -69,7 +69,7 @@ public Builder(String tableName)
* </p>
* @return a reference to this object.
*/
public Builder withAllowListing()
public Builder withAllowListing()
{
this.allowListing = true;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,11 @@ private void testListBuckets(String bucketType) throws Exception
Assert.assertEquals(ByteString.copyFrom(type.unsafeGetValue()), builder.getType());
}

@Test
public void listBucketsThrowsListException()
@Test(expected = ListException.class)

This comment has been minimized.

Copy link
@lukebakken

lukebakken Feb 21, 2017

Contributor

FANCY

public void listBucketsThrowsListException() throws ListException
{
boolean sawException = false;

ListBuckets.Builder b = new ListBuckets.Builder("bucket_type");
try
{
b.build();
}
catch (ListException ex)
{
sawException = true;
}

Assert.assertTrue(sawException);
b.build();
}

@Test
Expand Down

0 comments on commit 83f7779

Please sign in to comment.