@@ -355,18 +355,8 @@ fn test_request_put_player_squadnumber_unknown_response_status_not_found() {
355355fn test_request_post_players_body_empty_first_name_response_status_unprocessable_entity ( ) {
356356 // Arrange
357357 let client = setup_client_for_post ( ) ;
358- let body = serde_json:: json!( {
359- "firstName" : "" ,
360- "middleName" : "" ,
361- "lastName" : "Lo Celso" ,
362- "dateOfBirth" : "1996-07-09T00:00:00.000Z" ,
363- "squadNumber" : 27 ,
364- "position" : "Central Midfield" ,
365- "abbrPosition" : "CM" ,
366- "team" : "Real Betis Balompié" ,
367- "league" : "La Liga" ,
368- "starting11" : false
369- } ) ;
358+ let mut body = player_request_for_creation_json ( ) ;
359+ body[ "firstName" ] = serde_json:: json!( "" ) ;
370360 // Act
371361 let response = client
372362 . post ( "/players" )
@@ -382,18 +372,8 @@ fn test_request_post_players_body_empty_first_name_response_status_unprocessable
382372fn test_request_post_players_body_squad_number_zero_response_status_unprocessable_entity ( ) {
383373 // Arrange
384374 let client = setup_client_for_post ( ) ;
385- let body = serde_json:: json!( {
386- "firstName" : "Giovani" ,
387- "middleName" : "" ,
388- "lastName" : "Lo Celso" ,
389- "dateOfBirth" : "1996-07-09T00:00:00.000Z" ,
390- "squadNumber" : 0 ,
391- "position" : "Central Midfield" ,
392- "abbrPosition" : "CM" ,
393- "team" : "Real Betis Balompié" ,
394- "league" : "La Liga" ,
395- "starting11" : false
396- } ) ;
375+ let mut body = player_request_for_creation_json ( ) ;
376+ body[ "squadNumber" ] = serde_json:: json!( 0 ) ;
397377 // Act
398378 let response = client
399379 . post ( "/players" )
@@ -410,18 +390,8 @@ fn test_request_post_players_body_squad_number_above_maximum_response_status_unp
410390{
411391 // Arrange
412392 let client = setup_client_for_post ( ) ;
413- let body = serde_json:: json!( {
414- "firstName" : "Giovani" ,
415- "middleName" : "" ,
416- "lastName" : "Lo Celso" ,
417- "dateOfBirth" : "1996-07-09T00:00:00.000Z" ,
418- "squadNumber" : 100 ,
419- "position" : "Central Midfield" ,
420- "abbrPosition" : "CM" ,
421- "team" : "Real Betis Balompié" ,
422- "league" : "La Liga" ,
423- "starting11" : false
424- } ) ;
393+ let mut body = player_request_for_creation_json ( ) ;
394+ body[ "squadNumber" ] = serde_json:: json!( 100 ) ;
425395 // Act
426396 let response = client
427397 . post ( "/players" )
@@ -439,18 +409,8 @@ fn test_request_post_players_body_squad_number_above_maximum_response_status_unp
439409fn test_request_put_player_squadnumber_body_empty_last_name_response_status_unprocessable_entity ( ) {
440410 // Arrange
441411 let client = setup_client ( ) ;
442- let body = serde_json:: json!( {
443- "firstName" : "Emiliano" ,
444- "middleName" : "" ,
445- "lastName" : "" ,
446- "dateOfBirth" : "1992-09-02T00:00:00.000Z" ,
447- "squadNumber" : 23 ,
448- "position" : "Goalkeeper" ,
449- "abbrPosition" : "GK" ,
450- "team" : "Aston Villa FC" ,
451- "league" : "Premier League" ,
452- "starting11" : true
453- } ) ;
412+ let mut body = player_request_for_update_json ( ) ;
413+ body[ "lastName" ] = serde_json:: json!( "" ) ;
454414 // Act
455415 let response = client
456416 . put ( "/players/squadnumber/23" )
@@ -467,18 +427,8 @@ fn test_request_put_player_squadnumber_body_squad_number_zero_response_status_un
467427{
468428 // Arrange
469429 let client = setup_client ( ) ;
470- let body = serde_json:: json!( {
471- "firstName" : "Emiliano" ,
472- "middleName" : "" ,
473- "lastName" : "Martínez" ,
474- "dateOfBirth" : "1992-09-02T00:00:00.000Z" ,
475- "squadNumber" : 0 ,
476- "position" : "Goalkeeper" ,
477- "abbrPosition" : "GK" ,
478- "team" : "Aston Villa FC" ,
479- "league" : "Premier League" ,
480- "starting11" : true
481- } ) ;
430+ let mut body = player_request_for_update_json ( ) ;
431+ body[ "squadNumber" ] = serde_json:: json!( 0 ) ;
482432 // Act
483433 let response = client
484434 . put ( "/players/squadnumber/23" )
@@ -495,18 +445,8 @@ fn test_request_put_player_squadnumber_body_squad_number_above_maximum_response_
495445 {
496446 // Arrange
497447 let client = setup_client ( ) ;
498- let body = serde_json:: json!( {
499- "firstName" : "Emiliano" ,
500- "middleName" : "" ,
501- "lastName" : "Martínez" ,
502- "dateOfBirth" : "1992-09-02T00:00:00.000Z" ,
503- "squadNumber" : 100 ,
504- "position" : "Goalkeeper" ,
505- "abbrPosition" : "GK" ,
506- "team" : "Aston Villa FC" ,
507- "league" : "Premier League" ,
508- "starting11" : true
509- } ) ;
448+ let mut body = player_request_for_update_json ( ) ;
449+ body[ "squadNumber" ] = serde_json:: json!( 100 ) ;
510450 // Act
511451 let response = client
512452 . put ( "/players/squadnumber/23" )
0 commit comments