49
49
* @since 2024-06-12
50
50
*/
51
51
public class HttpToolTest {
52
+ private static final org .apache .logging .log4j .Logger log =
53
+ org .apache .logging .log4j .LogManager .getLogger (HttpToolTest .class );
54
+
52
55
private static final String TOOL_PATH = "tool/" ;
53
56
private static Integer port = null ;
54
57
private static final String DEFINITION_GROUP_NAME = "test_definition_group_name" ;
@@ -66,11 +69,13 @@ static void setupAll() {
66
69
if (port == null ) {
67
70
port = getLocalAvailablePort ();
68
71
}
72
+ log .warn ("!!!test in github action!!! setup all: port: {}" , port );
69
73
TestFitRuntime .INSTANCE .start (port );
70
74
}
71
75
72
76
@ AfterAll
73
77
static void teardownAll () {
78
+ log .warn ("!!!test in github action!!! teardown all" );
74
79
TestFitRuntime .INSTANCE .stop ();
75
80
}
76
81
@@ -132,11 +137,13 @@ void shouldReturnMap() {
132
137
133
138
Address address = Address .create ("jiangsu" , "suzhou" , 3205 );
134
139
Education education = Education .create ("QUST" , "UCAS" );
140
+ log .warn ("!!!test in github action!!! test shouldReturnMap, before execute tool" );
135
141
Map <String , Object > result = cast (tool .execute ("Alice" ,
136
142
26 ,
137
143
address ,
138
144
education ,
139
145
Stream .of ("0123-4567-8888" , "0123-4567-9999" ).collect (Collectors .toList ())));
146
+ log .warn ("!!!test in github action!!! test shouldReturnMap, after execute tool" );
140
147
Map <String , Object > addressResult = cast (result .get ("address" ));
141
148
Map <String , Object > educationResult = cast (result .get ("education" ));
142
149
List <String > phoneNumbers = cast (result .get ("phoneNumbers" ));
@@ -156,7 +163,9 @@ void shouldReturnString() {
156
163
Tool .Info info = readToolInfo ("string.json" );
157
164
Tool tool = createTool (info );
158
165
166
+ log .warn ("!!!test in github action!!! test shouldReturnString, before execute tool" );
159
167
String result = cast (tool .execute (Stream .of ("abc" , "def" , "ghi" ).collect (Collectors .toList ())));
168
+ log .warn ("!!!test in github action!!! test shouldReturnString, after execute tool" );
160
169
assertThat (result ).isEqualTo ("abc,def,ghi" );
161
170
}
162
171
@@ -166,7 +175,9 @@ void shouldReturnInteger() {
166
175
Tool .Info info = readToolInfo ("integer.json" );
167
176
Tool tool = createTool (info );
168
177
178
+ log .warn ("!!!test in github action!!! test shouldReturnInteger, before execute tool" );
169
179
Integer result = cast (tool .execute (Stream .of (1 , 2 , 3 ).collect (Collectors .toList ())));
180
+ log .warn ("!!!test in github action!!! test shouldReturnInteger, after execute tool" );
170
181
assertThat (result ).isEqualTo (6 );
171
182
}
172
183
@@ -176,7 +187,9 @@ void shouldReturnNull() {
176
187
Tool .Info info = readToolInfo ("void.json" );
177
188
Tool tool = createTool (info );
178
189
190
+ log .warn ("!!!test in github action!!! test shouldReturnNull, before execute tool" );
179
191
Object result = tool .execute ();
192
+ log .warn ("!!!test in github action!!! test shouldReturnNull, after execute tool" );
180
193
assertThat (result ).isEqualTo (null );
181
194
}
182
195
@@ -186,7 +199,9 @@ void BasicShouldReturnOk() {
186
199
Tool .Info info = readToolInfo ("basic-auth.json" );
187
200
Tool tool = createTool (info );
188
201
202
+ log .warn ("!!!test in github action!!! test BasicShouldReturnOk, before execute tool" );
189
203
boolean result = cast (tool .execute ("{\" name\" :\" testuser\" , \" pwd\" :\" testpass\" }" ));
204
+ log .warn ("!!!test in github action!!! test BasicShouldReturnOk, after execute tool" );
190
205
assertThat (result ).isEqualTo (true );
191
206
}
192
207
@@ -196,7 +211,9 @@ void ApiKeyShouldReturnOk() {
196
211
Tool .Info info = readToolInfo ("api-key-auth.json" );
197
212
Tool tool = createTool (info );
198
213
214
+ log .warn ("!!!test in github action!!! test ApiKeyShouldReturnOk, before execute tool" );
199
215
boolean result = cast (tool .execute ("{\" name\" :\" ApiKey\" , \" pwd\" :\" ApiKeyValue\" }" ));
216
+ log .warn ("!!!test in github action!!! test ApiKeyShouldReturnOk, after execute tool" );
200
217
assertThat (result ).isEqualTo (true );
201
218
}
202
219
@@ -206,7 +223,9 @@ void ApiKeyQueryShouldReturnOk() {
206
223
Tool .Info info = readToolInfo ("api-key-query-auth.json" );
207
224
Tool tool = createTool (info );
208
225
226
+ log .warn ("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, before execute tool" );
209
227
boolean result = cast (tool .execute ("{\" name\" :\" ApiKey\" , \" pwd\" :\" ApiKeyValue\" }" ));
228
+ log .warn ("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, after execute tool" );
210
229
assertThat (result ).isEqualTo (true );
211
230
}
212
231
@@ -216,7 +235,9 @@ void BearerShouldReturnOk() {
216
235
Tool .Info info = readToolInfo ("bearer-auth.json" );
217
236
Tool tool = createTool (info );
218
237
238
+ log .warn ("!!!test in github action!!! test BearerShouldReturnOk, before execute tool" );
219
239
boolean result = cast (tool .execute ("{\" name\" :\" test666666666\" , \" pwd\" :\" invalid\" }" ));
240
+ log .warn ("!!!test in github action!!! test BearerShouldReturnOk, after execute tool" );
220
241
assertThat (result ).isEqualTo (true );
221
242
}
222
243
}
0 commit comments