3131import org .junit .jupiter .api .BeforeAll ;
3232import org .junit .jupiter .api .DisplayName ;
3333import org .junit .jupiter .api .Test ;
34+ import org .slf4j .Logger ;
35+ import org .slf4j .LoggerFactory ;
3436
3537import java .io .IOException ;
3638import java .io .InputStream ;
4951 * @since 2024-06-12
5052 */
5153public class HttpToolTest {
54+ private static final Logger log = LoggerFactory .getLogger (HttpToolTest .class );
55+
5256 private static final String TOOL_PATH = "tool/" ;
5357 private static Integer port = null ;
5458 private static final String DEFINITION_GROUP_NAME = "test_definition_group_name" ;
@@ -66,11 +70,13 @@ static void setupAll() {
6670 if (port == null ) {
6771 port = getLocalAvailablePort ();
6872 }
73+ log .warn ("!!!test in github action!!! setup all: port: {}" , port );
6974 TestFitRuntime .INSTANCE .start (port );
7075 }
7176
7277 @ AfterAll
7378 static void teardownAll () {
79+ log .warn ("!!!test in github action!!! teardown all" );
7480 TestFitRuntime .INSTANCE .stop ();
7581 }
7682
@@ -132,11 +138,13 @@ void shouldReturnMap() {
132138
133139 Address address = Address .create ("jiangsu" , "suzhou" , 3205 );
134140 Education education = Education .create ("QUST" , "UCAS" );
141+ log .warn ("!!!test in github action!!! test shouldReturnMap, before execute tool" );
135142 Map <String , Object > result = cast (tool .execute ("Alice" ,
136143 26 ,
137144 address ,
138145 education ,
139146 Stream .of ("0123-4567-8888" , "0123-4567-9999" ).collect (Collectors .toList ())));
147+ log .warn ("!!!test in github action!!! test shouldReturnMap, after execute tool" );
140148 Map <String , Object > addressResult = cast (result .get ("address" ));
141149 Map <String , Object > educationResult = cast (result .get ("education" ));
142150 List <String > phoneNumbers = cast (result .get ("phoneNumbers" ));
@@ -156,7 +164,9 @@ void shouldReturnString() {
156164 Tool .Info info = readToolInfo ("string.json" );
157165 Tool tool = createTool (info );
158166
167+ log .warn ("!!!test in github action!!! test shouldReturnString, before execute tool" );
159168 String result = cast (tool .execute (Stream .of ("abc" , "def" , "ghi" ).collect (Collectors .toList ())));
169+ log .warn ("!!!test in github action!!! test shouldReturnString, after execute tool" );
160170 assertThat (result ).isEqualTo ("abc,def,ghi" );
161171 }
162172
@@ -166,7 +176,9 @@ void shouldReturnInteger() {
166176 Tool .Info info = readToolInfo ("integer.json" );
167177 Tool tool = createTool (info );
168178
179+ log .warn ("!!!test in github action!!! test shouldReturnInteger, before execute tool" );
169180 Integer result = cast (tool .execute (Stream .of (1 , 2 , 3 ).collect (Collectors .toList ())));
181+ log .warn ("!!!test in github action!!! test shouldReturnInteger, after execute tool" );
170182 assertThat (result ).isEqualTo (6 );
171183 }
172184
@@ -176,7 +188,9 @@ void shouldReturnNull() {
176188 Tool .Info info = readToolInfo ("void.json" );
177189 Tool tool = createTool (info );
178190
191+ log .warn ("!!!test in github action!!! test shouldReturnNull, before execute tool" );
179192 Object result = tool .execute ();
193+ log .warn ("!!!test in github action!!! test shouldReturnNull, after execute tool" );
180194 assertThat (result ).isEqualTo (null );
181195 }
182196
@@ -186,7 +200,9 @@ void BasicShouldReturnOk() {
186200 Tool .Info info = readToolInfo ("basic-auth.json" );
187201 Tool tool = createTool (info );
188202
203+ log .warn ("!!!test in github action!!! test BasicShouldReturnOk, before execute tool" );
189204 boolean result = cast (tool .execute ("{\" name\" :\" testuser\" , \" pwd\" :\" testpass\" }" ));
205+ log .warn ("!!!test in github action!!! test BasicShouldReturnOk, after execute tool" );
190206 assertThat (result ).isEqualTo (true );
191207 }
192208
@@ -196,7 +212,9 @@ void ApiKeyShouldReturnOk() {
196212 Tool .Info info = readToolInfo ("api-key-auth.json" );
197213 Tool tool = createTool (info );
198214
215+ log .warn ("!!!test in github action!!! test ApiKeyShouldReturnOk, before execute tool" );
199216 boolean result = cast (tool .execute ("{\" name\" :\" ApiKey\" , \" pwd\" :\" ApiKeyValue\" }" ));
217+ log .warn ("!!!test in github action!!! test ApiKeyShouldReturnOk, after execute tool" );
200218 assertThat (result ).isEqualTo (true );
201219 }
202220
@@ -206,7 +224,9 @@ void ApiKeyQueryShouldReturnOk() {
206224 Tool .Info info = readToolInfo ("api-key-query-auth.json" );
207225 Tool tool = createTool (info );
208226
227+ log .warn ("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, before execute tool" );
209228 boolean result = cast (tool .execute ("{\" name\" :\" ApiKey\" , \" pwd\" :\" ApiKeyValue\" }" ));
229+ log .warn ("!!!test in github action!!! test ApiKeyQueryShouldReturnOk, after execute tool" );
210230 assertThat (result ).isEqualTo (true );
211231 }
212232
@@ -216,7 +236,9 @@ void BearerShouldReturnOk() {
216236 Tool .Info info = readToolInfo ("bearer-auth.json" );
217237 Tool tool = createTool (info );
218238
239+ log .warn ("!!!test in github action!!! test BearerShouldReturnOk, before execute tool" );
219240 boolean result = cast (tool .execute ("{\" name\" :\" test666666666\" , \" pwd\" :\" invalid\" }" ));
241+ log .warn ("!!!test in github action!!! test BearerShouldReturnOk, after execute tool" );
220242 assertThat (result ).isEqualTo (true );
221243 }
222244}
0 commit comments