@@ -122,7 +122,8 @@ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorCorrectInBuilt
122
122
}
123
123
124
124
@ Test
125
- public void testValidatePrePostProcessFunctionsWithOpenAIConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
125
+ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorWrongInBuiltPrePostProcessFunction () {
126
+ // Testing with wrong PreProcessFunction
126
127
ConnectorAction action1 = new ConnectorAction (
127
128
TEST_ACTION_TYPE ,
128
129
TEST_METHOD_HTTP ,
@@ -132,8 +133,9 @@ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorWrongInBuiltPr
132
133
TEXT_DOCS_TO_BEDROCK_EMBEDDING_INPUT ,
133
134
OPENAI_EMBEDDING
134
135
);
135
- Throwable exception = assertThrows (IllegalArgumentException .class , () -> action1 .validatePrePostProcessFunctions (Map .of ()));
136
- assertEquals ("LLM service is openai, so PreProcessFunction should be openai PreProcessFunction" , exception .getMessage ());
136
+ action1 .validatePrePostProcessFunctions (Map .of ());
137
+
138
+ // Testing with wrong PostProcessFunction
137
139
ConnectorAction action2 = new ConnectorAction (
138
140
TEST_ACTION_TYPE ,
139
141
TEST_METHOD_HTTP ,
@@ -143,8 +145,7 @@ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorWrongInBuiltPr
143
145
TEXT_DOCS_TO_OPENAI_EMBEDDING_INPUT ,
144
146
COHERE_EMBEDDING
145
147
);
146
- exception = assertThrows (IllegalArgumentException .class , () -> action2 .validatePrePostProcessFunctions (Map .of ()));
147
- assertEquals ("LLM service is openai, so PostProcessFunction should be openai PostProcessFunction" , exception .getMessage ());
148
+ action2 .validatePrePostProcessFunctions (Map .of ());
148
149
}
149
150
150
151
@ Test
@@ -183,7 +184,8 @@ public void testValidatePrePostProcessFunctionsWithCohereConnectorCorrectInBuilt
183
184
}
184
185
185
186
@ Test
186
- public void testValidatePrePostProcessFunctionsWithCohereConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
187
+ public void testValidatePrePostProcessFunctionsWithCohereConnectorWrongInBuiltPrePostProcessFunction () {
188
+ // Testing with wrong PreProcessFunction
187
189
ConnectorAction action1 = new ConnectorAction (
188
190
TEST_ACTION_TYPE ,
189
191
TEST_METHOD_HTTP ,
@@ -193,8 +195,9 @@ public void testValidatePrePostProcessFunctionsWithCohereConnectorWrongInBuiltPr
193
195
TEXT_DOCS_TO_BEDROCK_EMBEDDING_INPUT ,
194
196
COHERE_EMBEDDING
195
197
);
196
- Throwable exception = assertThrows (IllegalArgumentException .class , () -> action1 .validatePrePostProcessFunctions (Map .of ()));
197
- assertEquals ("LLM service is cohere, so PreProcessFunction should be cohere PreProcessFunction" , exception .getMessage ());
198
+ action1 .validatePrePostProcessFunctions (Map .of ());
199
+
200
+ // Testing with wrong PostProcessFunction
198
201
ConnectorAction action2 = new ConnectorAction (
199
202
TEST_ACTION_TYPE ,
200
203
TEST_METHOD_HTTP ,
@@ -204,8 +207,7 @@ public void testValidatePrePostProcessFunctionsWithCohereConnectorWrongInBuiltPr
204
207
TEXT_DOCS_TO_COHERE_EMBEDDING_INPUT ,
205
208
OPENAI_EMBEDDING
206
209
);
207
- exception = assertThrows (IllegalArgumentException .class , () -> action2 .validatePrePostProcessFunctions (Map .of ()));
208
- assertEquals ("LLM service is cohere, so PostProcessFunction should be cohere PostProcessFunction" , exception .getMessage ());
210
+ action2 .validatePrePostProcessFunctions (Map .of ());
209
211
}
210
212
211
213
@ Test
@@ -243,7 +245,8 @@ public void testValidatePrePostProcessFunctionsWithBedrockConnectorCorrectInBuil
243
245
}
244
246
245
247
@ Test
246
- public void testValidatePrePostProcessFunctionsWithBedrockConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
248
+ public void testValidatePrePostProcessFunctionsWithBedrockConnectorWrongInBuiltPrePostProcessFunction () {
249
+ // Testing with wrong PreProcessFunction
247
250
ConnectorAction action1 = new ConnectorAction (
248
251
TEST_ACTION_TYPE ,
249
252
TEST_METHOD_HTTP ,
@@ -253,8 +256,9 @@ public void testValidatePrePostProcessFunctionsWithBedrockConnectorWrongInBuiltP
253
256
TEXT_DOCS_TO_COHERE_EMBEDDING_INPUT ,
254
257
BEDROCK_EMBEDDING
255
258
);
256
- Throwable exception = assertThrows (IllegalArgumentException .class , () -> action1 .validatePrePostProcessFunctions (Map .of ()));
257
- assertEquals ("LLM service is bedrock, so PreProcessFunction should be bedrock PreProcessFunction" , exception .getMessage ());
259
+ action1 .validatePrePostProcessFunctions (Map .of ());
260
+
261
+ // Testing with wrong PostProcessFunction
258
262
ConnectorAction action2 = new ConnectorAction (
259
263
TEST_ACTION_TYPE ,
260
264
TEST_METHOD_HTTP ,
@@ -264,8 +268,7 @@ public void testValidatePrePostProcessFunctionsWithBedrockConnectorWrongInBuiltP
264
268
TEXT_IMAGE_TO_BEDROCK_EMBEDDING_INPUT ,
265
269
COHERE_EMBEDDING
266
270
);
267
- exception = assertThrows (IllegalArgumentException .class , () -> action2 .validatePrePostProcessFunctions (Map .of ()));
268
- assertEquals ("LLM service is bedrock, so PostProcessFunction should be bedrock PostProcessFunction" , exception .getMessage ());
271
+ action2 .validatePrePostProcessFunctions (Map .of ());
269
272
}
270
273
271
274
@ Test
@@ -293,7 +296,8 @@ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWithCorrect
293
296
}
294
297
295
298
@ Test
296
- public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
299
+ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWrongInBuiltPrePostProcessFunction () {
300
+ // Testing with wrong PreProcessFunction
297
301
ConnectorAction action1 = new ConnectorAction (
298
302
TEST_ACTION_TYPE ,
299
303
TEST_METHOD_HTTP ,
@@ -303,12 +307,9 @@ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWrongInBuil
303
307
TEXT_DOCS_TO_COHERE_EMBEDDING_INPUT ,
304
308
DEFAULT_EMBEDDING
305
309
);
306
- Throwable exception = assertThrows (IllegalArgumentException .class , () -> action1 .validatePrePostProcessFunctions (Map .of ()));
307
- assertEquals (
308
- "LLM service is sagemaker, so PreProcessFunction should be connector.pre_process.default.embedding"
309
- + " or connector.pre_process.default.rerank" ,
310
- exception .getMessage ()
311
- );
310
+ action1 .validatePrePostProcessFunctions (Map .of ());
311
+
312
+ // Testing with wrong PostProcessFunction
312
313
ConnectorAction action2 = new ConnectorAction (
313
314
TEST_ACTION_TYPE ,
314
315
TEST_METHOD_HTTP ,
@@ -318,12 +319,7 @@ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWrongInBuil
318
319
TEXT_DOCS_TO_DEFAULT_EMBEDDING_INPUT ,
319
320
BEDROCK_EMBEDDING
320
321
);
321
- exception = assertThrows (IllegalArgumentException .class , () -> action2 .validatePrePostProcessFunctions (Map .of ()));
322
- assertEquals (
323
- "LLM service is sagemaker, so PostProcessFunction should be connector.post_process.default.embedding"
324
- + " or connector.post_process.default.rerank" ,
325
- exception .getMessage ()
326
- );
322
+ action2 .validatePrePostProcessFunctions (Map .of ());
327
323
}
328
324
329
325
@ Test
0 commit comments