Skip to content

Commit 83f7779

Browse files
committed
Fix some whitespace, simplify some test code
1 parent 3036f40 commit 83f7779

File tree

5 files changed

+11
-22
lines changed

5 files changed

+11
-22
lines changed

src/main/java/com/basho/riak/client/api/commands/buckets/ListBuckets.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public final class ListBuckets extends StreamableRiakCommand.StreamableRiakComma
7474
this.timeout = builder.timeout;
7575
this.type = builder.type;
7676

77-
if (builder.allowListing == false)
77+
if (!builder.allowListing)
7878
{
7979
throw new ListException();
8080
}
@@ -196,7 +196,7 @@ public Builder(String type)
196196
* </p>
197197
* @return a reference to this object.
198198
*/
199-
public Builder withAllowListing()
199+
public Builder withAllowListing()
200200
{
201201
this.allowListing = true;
202202
return this;

src/main/java/com/basho/riak/client/api/commands/kv/ListKeys.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public final class ListKeys extends StreamableRiakCommand.StreamableRiakCommandW
8484
this.namespace = builder.namespace;
8585
this.timeout = builder.timeout;
8686

87-
if (builder.allowListing == false)
87+
if (!builder.allowListing)
8888
{
8989
throw new ListException();
9090
}
@@ -193,7 +193,7 @@ public Builder(Namespace namespace)
193193
* </p>
194194
* @return a reference to this object.
195195
*/
196-
public Builder withAllowListing()
196+
public Builder withAllowListing()
197197
{
198198
this.allowListing = true;
199199
return this;

src/main/java/com/basho/riak/client/api/commands/mapreduce/BucketMapReduce.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected BucketMapReduce(BucketInput input, Builder builder) throws ListExcepti
1818
{
1919
super(input, builder);
2020

21-
if (builder.allowListing == false)
21+
if (!builder.allowListing)
2222
{
2323
throw new ListException();
2424
}
@@ -48,7 +48,7 @@ protected Builder self()
4848
* </p>
4949
* @return a reference to this object.
5050
*/
51-
public Builder withAllowListing()
51+
public Builder withAllowListing()
5252
{
5353
this.allowListing = true;
5454
return this;

src/main/java/com/basho/riak/client/api/commands/timeseries/ListKeys.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private ListKeys(ListKeys.Builder builder) throws ListException
2323
this.tableName = builder.tableName;
2424
this.timeout = builder.timeout;
2525

26-
if (builder.allowListing == false)
26+
if (!builder.allowListing)
2727
{
2828
throw new ListException();
2929
}
@@ -69,7 +69,7 @@ public Builder(String tableName)
6969
* </p>
7070
* @return a reference to this object.
7171
*/
72-
public Builder withAllowListing()
72+
public Builder withAllowListing()
7373
{
7474
this.allowListing = true;
7575
return this;

src/test/java/com/basho/riak/client/api/commands/buckets/ListBucketsTest.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,11 @@ private void testListBuckets(String bucketType) throws Exception
7171
Assert.assertEquals(ByteString.copyFrom(type.unsafeGetValue()), builder.getType());
7272
}
7373

74-
@Test
75-
public void listBucketsThrowsListException()
74+
@Test(expected = ListException.class)
75+
public void listBucketsThrowsListException() throws ListException
7676
{
77-
boolean sawException = false;
78-
7977
ListBuckets.Builder b = new ListBuckets.Builder("bucket_type");
80-
try
81-
{
82-
b.build();
83-
}
84-
catch (ListException ex)
85-
{
86-
sawException = true;
87-
}
88-
89-
Assert.assertTrue(sawException);
78+
b.build();
9079
}
9180

9281
@Test

0 commit comments

Comments
 (0)