@@ -159,7 +159,8 @@ public void zhiPuAiChatStreamNonTransientError() {
159159 public void zhiPuAiEmbeddingTransientError () {
160160
161161 EmbeddingList <Embedding > expectedEmbeddings = new EmbeddingList <>("list" ,
162- List .of (new Embedding (0 , new float [] { 9.9f , 8.8f })), "model" , new ZhiPuAiApi .Usage (10 , 10 , 10 ));
162+ List .of (new Embedding (0 , new float [] { 9.9f , 8.8f }), new Embedding (0 , new float [] { 9.9f , 8.8f })),
163+ "model" , new ZhiPuAiApi .Usage (10 , 10 , 10 ));
163164
164165 given (this .zhiPuAiApi .embeddings (isA (EmbeddingRequest .class )))
165166 .willThrow (new TransientAiException ("Transient Error 1" ))
@@ -169,9 +170,11 @@ public void zhiPuAiEmbeddingTransientError() {
169170 var result = this .embeddingModel
170171 .call (new org .springframework .ai .embedding .EmbeddingRequest (List .of ("text1" , "text2" ), options ));
171172
173+ assertThat (result .getResults ().size ()).isEqualTo (2 );
172174 assertThat (result ).isNotNull ();
175+ // choose the first result
173176 assertThat (result .getResult ().getOutput ()).isEqualTo (new float [] { 9.9f , 8.8f });
174- assertThat (this .retryListener .onSuccessRetryCount ).isEqualTo (0 );
177+ assertThat (this .retryListener .onSuccessRetryCount ).isEqualTo (2 );
175178 assertThat (this .retryListener .onErrorRetryCount ).isEqualTo (2 );
176179 }
177180
0 commit comments