5353import org .elasticsearch .xpack .inference .LocalStateInferencePlugin ;
5454import org .elasticsearch .xpack .inference .model .TestModel ;
5555import org .elasticsearch .xpack .inference .registry .ModelRegistry ;
56+ import org .elasticsearch .xpack .inference .registry .ModelStoreResponse ;
5657import org .elasticsearch .xpack .inference .services .elasticsearch .ElasticsearchInternalModel ;
5758import org .elasticsearch .xpack .inference .services .elasticsearch .ElasticsearchInternalService ;
5859import org .elasticsearch .xpack .inference .services .elasticsearch .ElserInternalServiceSettingsTests ;
@@ -600,7 +601,7 @@ public void testGetUnparsedModelMap_ThrowsResourceNotFound_WhenNoHitsReturned()
600601 }
601602
602603 public void testStoreModels_ReturnsEmptyList_WhenGivenNoModelsToStore () {
603- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
604+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
604605 modelRegistry .storeModels (List .of (), storeListener , TimeValue .THIRTY_SECONDS );
605606
606607 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
@@ -620,12 +621,12 @@ public void testStoreModels_StoresSingleInferenceEndpoint() {
620621 new TestModel .TestSecretSettings (secrets )
621622 );
622623
623- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
624+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
624625 modelRegistry .storeModels (List .of (model ), storeListener , TimeValue .THIRTY_SECONDS );
625626
626627 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
627628 assertThat (response .size (), Matchers .is (1 ));
628- assertThat (response .get (0 ), Matchers .is (new ModelRegistry . ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
629+ assertThat (response .get (0 ), Matchers .is (new ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
629630
630631 assertMinimalServiceSettings (modelRegistry , model );
631632
@@ -659,13 +660,13 @@ public void testStoreModels_StoresMultipleInferenceEndpoints() {
659660 new TestModel .TestSecretSettings (secrets )
660661 );
661662
662- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
663+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
663664 modelRegistry .storeModels (List .of (model1 , model2 ), storeListener , TimeValue .THIRTY_SECONDS );
664665
665666 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
666667 assertThat (response .size (), Matchers .is (2 ));
667- assertThat (response .get (0 ), Matchers .is (new ModelRegistry . ModelStoreResponse (inferenceId1 , RestStatus .CREATED , null )));
668- assertThat (response .get (1 ), Matchers .is (new ModelRegistry . ModelStoreResponse (inferenceId2 , RestStatus .CREATED , null )));
668+ assertThat (response .get (0 ), Matchers .is (new ModelStoreResponse (inferenceId1 , RestStatus .CREATED , null )));
669+ assertThat (response .get (1 ), Matchers .is (new ModelStoreResponse (inferenceId2 , RestStatus .CREATED , null )));
669670
670671 assertModelAndMinimalSettingsWithSecrets (modelRegistry , model1 , secrets );
671672 assertModelAndMinimalSettingsWithSecrets (modelRegistry , model2 , secrets );
@@ -716,12 +717,12 @@ public void testStoreModels_StoresOneModel_FailsToStoreSecond_WhenVersionConflic
716717 new TestModel .TestSecretSettings (secrets )
717718 );
718719
719- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
720+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
720721 modelRegistry .storeModels (List .of (model1 , model2 ), storeListener , TimeValue .THIRTY_SECONDS );
721722
722723 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
723724 assertThat (response .size (), Matchers .is (2 ));
724- assertThat (response .get (0 ), Matchers .is (new ModelRegistry . ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
725+ assertThat (response .get (0 ), Matchers .is (new ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
725726 assertThat (response .get (1 ).inferenceId (), Matchers .is (model2 .getInferenceEntityId ()));
726727 assertThat (response .get (1 ).status (), Matchers .is (RestStatus .CONFLICT ));
727728 assertTrue (response .get (1 ).failed ());
@@ -758,12 +759,12 @@ public void testStoreModels_StoresOneModel_RemovesSecondDuplicateModelFromList_D
758759 new TestModel .TestSecretSettings (secrets )
759760 );
760761
761- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
762+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
762763 modelRegistry .storeModels (List .of (model1 , model1 , model2 ), storeListener , TimeValue .THIRTY_SECONDS );
763764
764765 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
765766 assertThat (response .size (), Matchers .is (1 ));
766- assertThat (response .get (0 ), Matchers .is (new ModelRegistry . ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
767+ assertThat (response .get (0 ), Matchers .is (new ModelStoreResponse (inferenceId , RestStatus .CREATED , null )));
767768
768769 assertModelAndMinimalSettingsWithSecrets (modelRegistry , model1 , secrets );
769770 assertIndicesContainExpectedDocsCount (model1 , 2 );
@@ -783,7 +784,7 @@ public void testStoreModels_FailsToStoreModel_WhenInferenceIndexDocumentAlreadyE
783784
784785 storeCorruptedModel (model , false );
785786
786- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
787+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
787788 modelRegistry .storeModels (List .of (model ), storeListener , TimeValue .THIRTY_SECONDS );
788789
789790 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
@@ -837,7 +838,7 @@ public void testStoreModels_OnFailure_RemovesPartialWritesOfInferenceEndpoint()
837838 storeCorruptedModel (model1 , false );
838839 storeCorruptedModel (model2 , true );
839840
840- PlainActionFuture <List <ModelRegistry . ModelStoreResponse >> storeListener = new PlainActionFuture <>();
841+ PlainActionFuture <List <ModelStoreResponse >> storeListener = new PlainActionFuture <>();
841842 modelRegistry .storeModels (List .of (model1 , model2 , model3 ), storeListener , TimeValue .THIRTY_SECONDS );
842843
843844 var response = storeListener .actionGet (TimeValue .THIRTY_SECONDS );
0 commit comments