@@ -138,10 +138,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
138
138
& self . attributes
139
139
}
140
140
141
- async fn execute (
142
- & mut self ,
143
- fact_sheet : & mut FactSheet ,
144
- ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
141
+ async fn execute ( & mut self , fact_sheet : & mut FactSheet ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
145
142
while self . attributes . state != AgentState :: Finished {
146
143
match & self . attributes . state {
147
144
AgentState :: Discovery => {
@@ -173,7 +170,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
173
170
174
171
// Build and testing code
175
172
PrintCommand :: UnitTest . print_agent_message (
176
- & self . attributes . position . as_str ( ) , "Backend Code Unit Testing: building web server..." ) ;
173
+ & self . attributes . position . as_str ( ) , "Backend Code Unit Testing: Building web server..." ) ;
177
174
178
175
let build_backend_server: std:: process:: Output = Command :: new ( "cargo" )
179
176
. arg ( "build" )
@@ -219,9 +216,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
219
216
220
217
// define endpoints checks. Выбрать в итераторе только проверяемые ендпоинты
221
218
let check_endpoints: Vec < RouteObject > = api_endpoints. iter ( )
222
- . filter ( |& route_object: & RouteObject | {
223
- route_object. method == "get" && route_object. is_route_dynamic == "false"
224
- } )
219
+ . filter ( |& route_object| { route_object. method == "get" && route_object. is_route_dynamic == "false" } )
225
220
. cloned ( ) . collect ( ) ;
226
221
227
222
// Store API endpoints
@@ -260,7 +255,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
260
255
. build ( ) . unwrap ( ) ;
261
256
262
257
// test url
263
- let url: String = format ! ( "http://localhos :8080{}" , endpoint. route) ;
258
+ let url: String = format ! ( "http://127.0.0.1 :8080{}" , endpoint. route) ;
264
259
match check_status_code ( & client, & url) . await {
265
260
Ok ( status_code) => {
266
261
if status_code != 200 {
@@ -280,7 +275,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
280
275
}
281
276
282
277
save_api_endpoints ( & api_endpoints_str) ;
283
- PrintCommand :: Issue . print_agent_message (
278
+ PrintCommand :: Success . print_agent_message (
284
279
& self . attributes . position . as_str ( ) , "Backend Testing completed..." ) ;
285
280
286
281
run_backend_server. kill ( ) . expect ( "failed to Kill server on completion" ) ;
@@ -319,7 +314,8 @@ mod tests {
319
314
320
315
let mut factsheet: FactSheet = serde_json:: from_str ( factsheet_str) . unwrap ( ) ;
321
316
322
- agent. attributes . state = AgentState :: Discovery ;
317
+ // agent.attributes.state = AgentState::Discovery;
318
+ agent. attributes . state = AgentState :: UnitTesting ;
323
319
agent
324
320
. execute ( & mut factsheet)
325
321
. await
0 commit comments