hgeraldino commented on code in PR #13294:
URL: https://github.com/apache/kafka/pull/13294#discussion_r1139545378


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestClientTest.java:
##########
@@ -157,23 +161,55 @@ private void setupHttpClient(int responseCode, String 
responseJsonString) throws
             when(httpClient.newRequest(anyString())).thenReturn(req);
         }
 
+        @Test
+        public void testNullUrl() throws Exception {
+            int statusCode = Response.Status.OK.getStatusCode();
+            setupHttpClient(statusCode, toJsonString(TEST_DTO));
+
+            assertThrows(NullPointerException.class, () -> httpRequest(
+                    httpClient, null, "GET", null, null, new 
TypeReference<Void>() { }, null, null

Review Comment:
   Because the exception being thrown is somewhat generic, I'd probably pass 
valid values for all arguments except the one that is under test, just to make 
sure that the NPE is being thrown by the proper check



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to