lukasz-antoniak commented on code in PR #2060:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2060#discussion_r2497665242


##########
integration-tests/src/test/java/com/datastax/oss/driver/core/tracker/RequestIdGeneratorIT.java:
##########
@@ -122,4 +124,23 @@ public void 
should_not_write_id_to_custom_payload_when_key_is_not_set() {
       
assertThat(rs.getExecutionInfo().getRequest().getCustomPayload().get("trace_key")).isNull();
     }
   }
+
+  @Test
+  public void should_succeed_with_null_value_in_custom_payload() {
+    DriverConfigLoader loader =
+        SessionUtils.configLoaderBuilder()
+            .withString(
+                DefaultDriverOption.REQUEST_ID_GENERATOR_CLASS, 
"W3CContextRequestIdGenerator")
+            .build();
+    try (CqlSession session = SessionUtils.newSession(ccmRule, loader)) {
+      String query = "SELECT * FROM system.local";
+      Map<String, ByteBuffer> customPayload =
+          new NullAllowingImmutableMap.Builder<String, 
ByteBuffer>(1).put("my_key", null).build();
+      SimpleStatement statement =
+          SimpleStatement.newInstance(query).setCustomPayload(customPayload);
+      assertThatStage(session.executeAsync(statement)).isSuccess();
+      ResultSet rs = session.execute(query);
+      
assertThat(rs.getExecutionInfo().getRequest().getCustomPayload().get("trace_key")).isNull();

Review Comment:
   IMO this assertion is not needed in this test.



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