File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed 
java/test/org/openqa/selenium/remote Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 5151import  org .openqa .selenium .remote .http .ClientConfig ;
5252import  org .openqa .selenium .remote .http .Contents ;
5353import  org .openqa .selenium .remote .http .HttpClient ;
54+ import  org .openqa .selenium .remote .http .HttpMethod ;
5455import  org .openqa .selenium .remote .http .HttpResponse ;
5556
5657@ Tag ("UnitTests" )
@@ -234,4 +235,22 @@ public void quit() {
234235      quitCalled  = true ;
235236    }
236237  }
238+ 
239+   @ Test 
240+   void  additionalCommandsCanBeModified () throws  MalformedURLException  {
241+     HttpClient  client  = mock (HttpClient .class );
242+     HttpClient .Factory  factory  = mock (HttpClient .Factory .class );
243+ 
244+     when (factory .createClient (any (ClientConfig .class ))).thenReturn (client );
245+ 
246+     URL  url  = new  URL ("http://localhost:4444/" );
247+     HttpCommandExecutor  executor  =
248+         new  HttpCommandExecutor (emptyMap (), ClientConfig .defaultConfig ().baseUrl (url ), factory );
249+ 
250+     String  commandName  = "customCommand" ;
251+     CommandInfo  commandInfo  = new  CommandInfo ("/session/:sessionId/custom" , HttpMethod .GET );
252+     executor .addAdditionalCommand (commandName , commandInfo );
253+ 
254+     assertThat (executor .getAdditionalCommands ()).containsEntry (commandName , commandInfo );
255+   }
237256}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments