reswqa commented on code in PR #22445:
URL: https://github.com/apache/flink/pull/22445#discussion_r1176019508


##########
flink-queryable-state/flink-queryable-state-client-java/src/test/java/org/apache/flink/queryablestate/client/state/ImmutableAggregatingStateTest.java:
##########
@@ -53,20 +54,28 @@ public void setUp() throws Exception {
         aggrState = ImmutableAggregatingState.createState(aggrStateDesc, 
out.toByteArray());
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void testUpdate() throws Exception {
-        String value = aggrState.get();
-        assertEquals("42", value);
+    @Test
+    void testUpdate() {
+        assertThatThrownBy(
+                        () -> {
+                            String value = aggrState.get();
+                            assertEquals("42", value);

Review Comment:
   All assertions should be migrated to AssertJ.



##########
flink-queryable-state/flink-queryable-state-client-java/src/test/java/org/apache/flink/queryablestate/client/state/ImmutableAggregatingStateTest.java:
##########
@@ -53,20 +54,28 @@ public void setUp() throws Exception {
         aggrState = ImmutableAggregatingState.createState(aggrStateDesc, 
out.toByteArray());
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void testUpdate() throws Exception {
-        String value = aggrState.get();
-        assertEquals("42", value);
+    @Test
+    void testUpdate() {
+        assertThatThrownBy(
+                        () -> {
+                            String value = aggrState.get();
+                            assertEquals("42", value);
 
-        aggrState.add(54L);
+                            aggrState.add(54L);

Review Comment:
   We should make the code block of `assertThatThrownBy` as small as possible, 
ideally it only contains codes that will throw errors.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to