@@ -734,6 +734,30 @@ public void testUpdateLocalModelWithExternalRemoteInformation() {
734734 assertEquals ("Trying to update the connector or connector_id field on a local model." , argumentCaptor .getValue ().getMessage ());
735735 }
736736
737+ @ Test
738+ public void testRetryConnectorWhenNotProvidedInRequestBody () {
739+ MLModel testUpdateModelCacheModel = prepareMLModel ("REMOTE_INTERNAL" , MLModelState .DEPLOYED );
740+ doAnswer (invocation -> {
741+ ActionListener <MLModel > listener = invocation .getArgument (4 );
742+ listener .onResponse (testUpdateModelCacheModel );
743+ return null ;
744+ }).when (mlModelManager ).getModel (eq ("test_model_id" ), any (), any (), any (), isA (ActionListener .class ));
745+
746+ doAnswer (invocation -> {
747+ ActionListener <MLUpdateModelCacheNodesResponse > listener = invocation .getArgument (2 );
748+ listener .onResponse (updateModelCacheNodesResponse );
749+ return null ;
750+ }).when (client ).execute (any (), any (), isA (ActionListener .class ));
751+ testUpdateModelCacheModel .setConnector (null );
752+ transportUpdateModelAction .doExecute (task , prepareRemoteRequest ("REMOTE_INTERNAL" ), actionListener );
753+ ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
754+ verify (actionListener ).onFailure (argumentCaptor .capture ());
755+ assertEquals (
756+ "Cannot update connector settings for this model. The model was created with a connector_id and does not have an inline connector." ,
757+ argumentCaptor .getValue ().getMessage ()
758+ );
759+ }
760+
737761 @ Test
738762 public void testUpdateLocalModelWithInternalRemoteInformation () {
739763 transportUpdateModelAction .doExecute (task , prepareRemoteRequest ("REMOTE_INTERNAL" ), actionListener );
0 commit comments