@@ -351,12 +351,36 @@ public void testBadProxyDestination() throws Exception
351351 Assert .assertFalse ("overlord called" , OVERLORD_EXPECTED_REQUEST .called );
352352 }
353353
354+ @ Test
355+ public void testCoordinatorNoPath () throws Exception
356+ {
357+ HttpURLConnection connection = ((HttpURLConnection )
358+ new URL (StringUtils .format ("http://localhost:%d/proxy/coordinator" , port )).openConnection ());
359+ connection .setRequestMethod ("GET" );
360+
361+ Assert .assertEquals (403 , connection .getResponseCode ()); // proxy with no path is not allowed
362+ Assert .assertFalse ("coordinator called" , COORDINATOR_EXPECTED_REQUEST .called );
363+ Assert .assertFalse ("overlord called" , OVERLORD_EXPECTED_REQUEST .called );
364+ }
365+
366+ @ Test
367+ public void testOverlordNoPath () throws Exception
368+ {
369+ HttpURLConnection connection = ((HttpURLConnection )
370+ new URL (StringUtils .format ("http://localhost:%d/proxy/overlord" , port )).openConnection ());
371+ connection .setRequestMethod ("GET" );
372+
373+ Assert .assertEquals (403 , connection .getResponseCode ()); // proxy with no path is not allowed
374+ Assert .assertFalse ("coordinator called" , COORDINATOR_EXPECTED_REQUEST .called );
375+ Assert .assertFalse ("overlord called" , OVERLORD_EXPECTED_REQUEST .called );
376+ }
377+
354378 @ Test
355379 public void testCoordinatorLeaderUnknown () throws Exception
356380 {
357381 isValidLeader = false ;
358382 HttpURLConnection connection = ((HttpURLConnection )
359- new URL (StringUtils .format ("http://localhost:%d/druid/coordinator" , port )).openConnection ());
383+ new URL (StringUtils .format ("http://localhost:%d/druid/coordinator/status " , port )).openConnection ());
360384 connection .setRequestMethod ("GET" );
361385
362386 Assert .assertEquals (503 , connection .getResponseCode ());
@@ -369,7 +393,7 @@ public void testOverlordLeaderUnknown() throws Exception
369393 {
370394 isValidLeader = false ;
371395 HttpURLConnection connection = ((HttpURLConnection )
372- new URL (StringUtils .format ("http://localhost:%d/druid/indexer" , port )).openConnection ());
396+ new URL (StringUtils .format ("http://localhost:%d/druid/indexer/status " , port )).openConnection ());
373397 connection .setRequestMethod ("GET" );
374398
375399 Assert .assertEquals (503 , connection .getResponseCode ());
0 commit comments