singhpk234 commented on code in PR #14562:
URL: https://github.com/apache/iceberg/pull/14562#discussion_r2516619173


##########
core/src/test/java/org/apache/iceberg/rest/responses/TestPlanTableScanResponseParser.java:
##########
@@ -65,6 +64,45 @@ public void roundTripSerdeWithEmptyObject() {
         .hasMessage("Cannot parse planTableScan response from empty or null 
object");
   }
 
+  @Test
+  public void roundTripSerdeWithCompletedPlanningWithAndWithoutPlanId() {
+    PlanTableScanResponse response =
+        PlanTableScanResponse.builder()
+            .withPlanStatus(PlanStatus.COMPLETED)
+            .withSpecsById(PARTITION_SPECS_BY_ID)
+            .build();
+    assertThat(response.planStatus()).isEqualTo(PlanStatus.COMPLETED);
+    assertThat(response.planId()).isNull();
+    assertThat(PlanTableScanResponseParser.toJson(response))
+        .isEqualTo("{\"plan-status\":\"completed\"}");
+
+    response =
+        PlanTableScanResponse.builder()
+            .withPlanStatus(PlanStatus.COMPLETED)
+            .withPlanId("somePlanId")
+            .withSpecsById(PARTITION_SPECS_BY_ID)
+            .build();
+    assertThat(response.planStatus()).isEqualTo(PlanStatus.COMPLETED);
+    assertThat(response.planId()).isEqualTo("somePlanId");
+
+    assertThat(PlanTableScanResponseParser.toJson(response))
+        
.isEqualTo("{\"plan-status\":\"completed\",\"plan-id\":\"somePlanId\"}");
+  }
+
+  @Test
+  public void roundTripSerdeWithSubmittedPlanningWithPlanId() {
+    PlanTableScanResponse response =
+        PlanTableScanResponse.builder()
+            .withPlanStatus(PlanStatus.SUBMITTED)
+            .withSpecsById(PARTITION_SPECS_BY_ID)
+            .withPlanId("somePlanId")

Review Comment:
   we can address this later :) !



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to