liuxiaocs7 commented on code in PR #8190:
URL: https://github.com/apache/hbase/pull/8190#discussion_r3218513112
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java:
##########
@@ -359,13 +359,15 @@ public void
testCheckAndMutateWithFilterAndTimeRangeForOldApi() throws Throwable
}
}
- @Test(expected = NullPointerException.class)
+ @Test
@Deprecated
public void testCheckAndMutateWithoutConditionForOldApi() throws Throwable {
- try (Table table = createTable()) {
- table.checkAndMutate(ROWKEY, FAMILY)
- .thenPut(new Put(ROWKEY).addColumn(FAMILY, Bytes.toBytes("D"),
Bytes.toBytes("d")));
- }
+ assertThrows(NullPointerException.class, () -> {
+ try (Table table = createTable()) {
+ table.checkAndMutate(ROWKEY, FAMILY)
+ .thenPut(new Put(ROWKEY).addColumn(FAMILY, Bytes.toBytes("D"),
Bytes.toBytes("d")));
+ }
+ });
Review Comment:
The scope can be smaller?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestCheckAndMutate.java:
##########
@@ -590,10 +592,12 @@ public void testCheckAndMutateWithFilterAndTimeRange()
throws Throwable {
}
}
- @Test(expected = IllegalStateException.class)
+ @Test
public void testCheckAndMutateBuilderWithoutCondition() {
- CheckAndMutate.newBuilder(ROWKEY)
- .build(new Put(ROWKEY).addColumn(FAMILY, Bytes.toBytes("D"),
Bytes.toBytes("d")));
+ assertThrows(IllegalStateException.class, () -> {
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]