Testing Flows
Description No.1
Max calls GET /players/search/ to find players based on specific criteria. He thinks "Christian McCaffrey" is a fire potential pick which will lead to the W, So he searched for the player to see his current age because he doesn't know if he's washed or not yet.
Max then calls GET /players/{player_id}/ to retrieve detailed statistics and history for "Christian McCaffrey," after finding out he's still a young lad.
Satisfied with the stats, Max calls POST /players/{player_id}/draft to add "Christian McCaffrey" to his team's lineup.
Testing Flow No.1
Max initiates a search for Christian McCaffrey GET /players/search/ with the specified parameters.
curl -X 'GET' \
'https://mockmaster.onrender.com/players/search/?player_name=Christian%20McCaffrey&sort_col=ppr_fantasy_points&sort_order=desc' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
{
"previous": "",
"next": "",
"results": [
{
"player_id": "McCaCh01",
"player_name": "Christian McCaffrey",
"position": "RB",
"team": "SFO",
"age": 27,
"standard_fantasy_points": 324,
"ppr_fantasy_points": 391.3
}
]
}
Max retrieves detailed statistics for "Christian McCaffrey" using GET /players/McCaCh01/.
curl -X 'GET' \
'https://mockmaster.onrender.com/players/McCaCh01/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
{
"player_stats": {
"history": [
{
"player_id": "McCaCh01",
"year": 2023,
"age": 27,
"position": "RB",
"team": "SFO",
"games_played": 16,
"games_started": 16,
"passing_yards": 0,
"passing_tds": 0,
"interceptions": 0,
"rushing_atts": 272,
"rushing_yards": 1459,
"targets": 83,
"receptions": 67,
"receiving_yards": 564,
"receiving_tds": 7,
"fumbles": 3,
"fumbles_lost": 2,
"two_point_conversions": 0,
"fantasy_points_standard_10": 324,
"fantasy_points_ppr_10": 391.3,
"rushing_tds": 14,
"two_point_conversions_passing": 0
}
]
}
}
Max drafts "Christian McCaffrey" to his team using POST /players/McCaCh01/draft.
curl -X 'POST' \
'https://mockmaster.onrender.com/players/McCaCh01/draft' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_id": 0
}'
{
"detail": "Player already drafted or team not found"
}
Sadly, the player he wanted was already drafted.
Description No.2
Rachel calls /drafts/ to create the draft.
Then Rachel calls PUT /drafts/{draft_id}/start to begin the draft event.
Rachel wants to call a quick pause, so she pauses the draft using PUT /drafts/{draft_id}/pause to temporarily halt the drafting process.
After feeling like drafting again, Rachel resumes the draft using PUT /drafts/{draft_id}/resume to allow teams to continue making selections.
Once all selections are complete, Rachel ends the draft using PUT /drafts/{draft_id}/end.
Testing Flow No.2
Rachel starts the draft using POST /drafts/.
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"draft_type": "string",
"draft_name": "string",
"draft_size": 0,
"draft_length": 0,
"roster_positions": [
{
"position": "string",
"min_num": 0,
"max_num": 0
}
],
"flex_spots": 0,
"roster_size": 0,
"team_name": "string",
"user_name": "string"
}'
Rachel starts the draft using PUT /drafts/19/start to initiate the drafting process.
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/19/start' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
{
"success": true,
"message": "Draft started and draft positions assigned randomly"
}
Rachel pauses the draft with PUT /drafts/19/pause to temporarily suspend the drafting process.
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/19/pause' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
Rachel resumes the draft with PUT /drafts/19/resume to allow teams to continue making selections.
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/19/resume' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
{
"success": true,
"message": "Draft resumed successfully"
}
Finally, Rachel ends the draft with PUT /drafts/19/end once all selections are complete.
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/19/end' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
Description No.3
Jack, with the username "jackAttack123", initiates a draft by calling POST /drafts/. This creates a new draft room with a unique ID. Liam, whose username is "LiamTheLegend", searches for available draft rooms using GET /drafts to find Jack's draft room. Upon finding it, he joins the draft room by calling POST /drafts/{draft_id}/join with his desired team name.
After joining the draft room, Liam decides to update his team name to reflect his personality. He calls PUT /teams/{team_id}/ with his new team name to make the change.
Testing Flow No.3
Jack aka "jackAttack123" initiates a mock draft event by calling POST /drafts/ with specific parameters.
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"draft_type": "string",
"draft_name": "123",
"draft_size": 10,
"draft_length": 0,
"roster_positions": [
{
"position": "string",
"min_num": 0,
"max_num": 0
}
],
"flex_spots": 0,
"roster_size": 0,
"team_name": "string",
"user_name": "string"
}'
Liam, with the username "LiamTheLegend", searches for available draft rooms using GET /drafts.
curl -X 'GET' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
[
{
"draft_id": 15,
"draft_name": "Fantastic Footies",
"draft_type": "LOL",
"draft_size": 1200,
"roster_size": 100,
"draft_length": 11,
"flex_spots": 60
},
{
"draft_id": 17,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 18,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 20,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 21,
"draft_name": "123",
"draft_type": "string",
"draft_size": 10,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
}
]
Liam joins the draft room by calling POST /drafts/21/join with his desired team name.
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/21/join' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Yay",
"user_name": "LiamTheLegend"
}'
Liam decides to update his team name to something better using PUT /teams/34/.
curl -X 'PUT' \
'https://mockmaster.onrender.com/teams/34/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Better Name"
}'
Results in:
Liam was not able to change his name.
Testing Flows
Description No.1
Max calls GET /players/search/ to find players based on specific criteria. He thinks "Christian McCaffrey" is a fire potential pick which will lead to the W, So he searched for the player to see his current age because he doesn't know if he's washed or not yet.
Max then calls GET /players/{player_id}/ to retrieve detailed statistics and history for "Christian McCaffrey," after finding out he's still a young lad.
Satisfied with the stats, Max calls POST /players/{player_id}/draft to add "Christian McCaffrey" to his team's lineup.
Testing Flow No.1
Max initiates a search for Christian McCaffrey GET /players/search/ with the specified parameters.
Max retrieves detailed statistics for "Christian McCaffrey" using GET /players/McCaCh01/.
Max drafts "Christian McCaffrey" to his team using POST /players/McCaCh01/draft.
Sadly, the player he wanted was already drafted.
Description No.2
Rachel calls /drafts/ to create the draft.
Then Rachel calls PUT /drafts/{draft_id}/start to begin the draft event.
Rachel wants to call a quick pause, so she pauses the draft using PUT /drafts/{draft_id}/pause to temporarily halt the drafting process.
After feeling like drafting again, Rachel resumes the draft using PUT /drafts/{draft_id}/resume to allow teams to continue making selections.
Once all selections are complete, Rachel ends the draft using PUT /drafts/{draft_id}/end.
Testing Flow No.2
Rachel starts the draft using POST /drafts/.
Rachel starts the draft using PUT /drafts/19/start to initiate the drafting process.
Rachel pauses the draft with PUT /drafts/19/pause to temporarily suspend the drafting process.
Rachel resumes the draft with PUT /drafts/19/resume to allow teams to continue making selections.
Finally, Rachel ends the draft with PUT /drafts/19/end once all selections are complete.
Description No.3
Jack, with the username "jackAttack123", initiates a draft by calling POST /drafts/. This creates a new draft room with a unique ID. Liam, whose username is "LiamTheLegend", searches for available draft rooms using GET /drafts to find Jack's draft room. Upon finding it, he joins the draft room by calling POST /drafts/{draft_id}/join with his desired team name.
After joining the draft room, Liam decides to update his team name to reflect his personality. He calls PUT /teams/{team_id}/ with his new team name to make the change.
Testing Flow No.3
Jack aka "jackAttack123" initiates a mock draft event by calling POST /drafts/ with specific parameters.
Liam, with the username "LiamTheLegend", searches for available draft rooms using GET /drafts.
Liam joins the draft room by calling POST /drafts/21/join with his desired team name.
Liam decides to update his team name to something better using PUT /teams/34/.
Results in:
Liam was not able to change his name.