@@ -86,14 +86,13 @@ public void constructor_NullMethod() {
86
86
}
87
87
88
88
@ Test
89
- public void connectorWithNullPreProcessFunction () {
89
+ public void testValidatePrePostProcessFunctionsWithNullPreProcessFunctionSuccess () {
90
90
ConnectorAction action = new ConnectorAction (TEST_ACTION_TYPE , TEST_METHOD_HTTP , OPENAI_URL , null , TEST_REQUEST_BODY , null , null );
91
91
action .validatePrePostProcessFunctions (Map .of ());
92
- assertNotNull (action );
93
92
}
94
93
95
94
@ Test
96
- public void connectorWithCustomPainlessScriptPreProcessFunction () {
95
+ public void testValidatePrePostProcessFunctionsWithCustomPainlessScriptPreProcessFunctionSuccess () {
97
96
String preProcessFunction =
98
97
"\" \\ n StringBuilder builder = new StringBuilder();\\ n builder.append(\\ \" \\ \\ \\ \" \\ \" );\\ n String first = params.text_docs[0];\\ n builder.append(first);\\ n builder.append(\\ \" \\ \\ \\ \" \\ \" );\\ n def parameters = \\ \" {\\ \" +\\ \" \\ \\ \\ \" text_inputs\\ \\ \\ \" :\\ \" + builder + \\ \" }\\ \" ;\\ n return \\ \" {\\ \" +\\ \" \\ \\ \\ \" parameters\\ \\ \\ \" :\\ \" + parameters + \\ \" }\\ \" ;\" " ;
99
98
ConnectorAction action = new ConnectorAction (
@@ -106,11 +105,10 @@ public void connectorWithCustomPainlessScriptPreProcessFunction() {
106
105
null
107
106
);
108
107
action .validatePrePostProcessFunctions (null );
109
- assertNotNull (action );
110
108
}
111
109
112
110
@ Test
113
- public void openAIConnectorWithCorrectInBuiltPrePostProcessFunction () {
111
+ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorCorrectInBuiltPrePostProcessFunctionAndParamsSuccess () {
114
112
ConnectorAction action = new ConnectorAction (
115
113
TEST_ACTION_TYPE ,
116
114
TEST_METHOD_HTTP ,
@@ -121,11 +119,10 @@ public void openAIConnectorWithCorrectInBuiltPrePostProcessFunction() {
121
119
OPENAI_EMBEDDING
122
120
);
123
121
action .validatePrePostProcessFunctions (Map .of ("endpoint" , "api.openai.com" ));
124
- assertNotNull (action );
125
122
}
126
123
127
124
@ Test
128
- public void openAIConnectorWithWrongInBuiltPrePostProcessFunction () {
125
+ public void testValidatePrePostProcessFunctionsWithOpenAIConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
129
126
ConnectorAction action1 = new ConnectorAction (
130
127
TEST_ACTION_TYPE ,
131
128
TEST_METHOD_HTTP ,
@@ -151,7 +148,7 @@ public void openAIConnectorWithWrongInBuiltPrePostProcessFunction() {
151
148
}
152
149
153
150
@ Test
154
- public void cohereConnectorWithCorrectInBuiltPrePostProcessFunction () {
151
+ public void testValidatePrePostProcessFunctionsWithCohereConnectorCorrectInBuiltPrePostProcessFunctionSuccess () {
155
152
ConnectorAction action = new ConnectorAction (
156
153
TEST_ACTION_TYPE ,
157
154
TEST_METHOD_HTTP ,
@@ -162,7 +159,6 @@ public void cohereConnectorWithCorrectInBuiltPrePostProcessFunction() {
162
159
COHERE_EMBEDDING
163
160
);
164
161
action .validatePrePostProcessFunctions (Map .of ());
165
- assertNotNull (action );
166
162
action = new ConnectorAction (
167
163
TEST_ACTION_TYPE ,
168
164
TEST_METHOD_HTTP ,
@@ -173,7 +169,6 @@ public void cohereConnectorWithCorrectInBuiltPrePostProcessFunction() {
173
169
COHERE_EMBEDDING
174
170
);
175
171
action .validatePrePostProcessFunctions (Map .of ());
176
- assertNotNull (action );
177
172
action = new ConnectorAction (
178
173
TEST_ACTION_TYPE ,
179
174
TEST_METHOD_HTTP ,
@@ -188,7 +183,7 @@ public void cohereConnectorWithCorrectInBuiltPrePostProcessFunction() {
188
183
}
189
184
190
185
@ Test
191
- public void cohereConnectorWithWrongInBuiltPrePostProcessFunction () {
186
+ public void testValidatePrePostProcessFunctionsWithCohereConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
192
187
ConnectorAction action1 = new ConnectorAction (
193
188
TEST_ACTION_TYPE ,
194
189
TEST_METHOD_HTTP ,
@@ -214,7 +209,7 @@ public void cohereConnectorWithWrongInBuiltPrePostProcessFunction() {
214
209
}
215
210
216
211
@ Test
217
- public void bedrockConnectorWithCorrectInBuiltPrePostProcessFunction () {
212
+ public void testValidatePrePostProcessFunctionsWithBedrockConnectorCorrectInBuiltPrePostProcessFunctionSuccess () {
218
213
ConnectorAction action = new ConnectorAction (
219
214
TEST_ACTION_TYPE ,
220
215
TEST_METHOD_HTTP ,
@@ -225,7 +220,6 @@ public void bedrockConnectorWithCorrectInBuiltPrePostProcessFunction() {
225
220
BEDROCK_EMBEDDING
226
221
);
227
222
action .validatePrePostProcessFunctions (Map .of ());
228
- assertNotNull (action );
229
223
action = new ConnectorAction (
230
224
TEST_ACTION_TYPE ,
231
225
TEST_METHOD_HTTP ,
@@ -236,7 +230,6 @@ public void bedrockConnectorWithCorrectInBuiltPrePostProcessFunction() {
236
230
BEDROCK_BATCH_JOB_ARN
237
231
);
238
232
action .validatePrePostProcessFunctions (Map .of ());
239
- assertNotNull (action );
240
233
action = new ConnectorAction (
241
234
TEST_ACTION_TYPE ,
242
235
TEST_METHOD_HTTP ,
@@ -247,11 +240,10 @@ public void bedrockConnectorWithCorrectInBuiltPrePostProcessFunction() {
247
240
BEDROCK_RERANK
248
241
);
249
242
action .validatePrePostProcessFunctions (Map .of ());
250
- assertNotNull (action );
251
243
}
252
244
253
245
@ Test
254
- public void bedrockConnectorWithWrongInBuiltPrePostProcessFunction () {
246
+ public void testValidatePrePostProcessFunctionsWithBedrockConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
255
247
ConnectorAction action1 = new ConnectorAction (
256
248
TEST_ACTION_TYPE ,
257
249
TEST_METHOD_HTTP ,
@@ -277,7 +269,7 @@ public void bedrockConnectorWithWrongInBuiltPrePostProcessFunction() {
277
269
}
278
270
279
271
@ Test
280
- public void sagemakerConnectorWithCorrectInBuiltPrePostProcessFunction () {
272
+ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWithCorrectInBuiltPrePostProcessFunctionSuccess () {
281
273
ConnectorAction action = new ConnectorAction (
282
274
TEST_ACTION_TYPE ,
283
275
TEST_METHOD_HTTP ,
@@ -288,7 +280,6 @@ public void sagemakerConnectorWithCorrectInBuiltPrePostProcessFunction() {
288
280
DEFAULT_EMBEDDING
289
281
);
290
282
action .validatePrePostProcessFunctions (Map .of ());
291
- assertNotNull (action );
292
283
action = new ConnectorAction (
293
284
TEST_ACTION_TYPE ,
294
285
TEST_METHOD_HTTP ,
@@ -299,11 +290,10 @@ public void sagemakerConnectorWithCorrectInBuiltPrePostProcessFunction() {
299
290
DEFAULT_RERANK
300
291
);
301
292
action .validatePrePostProcessFunctions (Map .of ());
302
- assertNotNull (action );
303
293
}
304
294
305
295
@ Test
306
- public void sagemakerConnectorWithWrongInBuiltPrePostProcessFunction () {
296
+ public void testValidatePrePostProcessFunctionsWithSagemakerConnectorWrongInBuiltPrePostProcessFunctionThrowsException () {
307
297
ConnectorAction action1 = new ConnectorAction (
308
298
TEST_ACTION_TYPE ,
309
299
TEST_METHOD_HTTP ,
0 commit comments