-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Milestone
Description
Description
It's time to write Unit Tests for the Breakpoint Service to verify it covers all user-case
BreakpointServiceTests file
In general, it's similar to #209:
- Start the Core
- Setup Breakpoint Rule with the given criteria
- Make a request to
httpbin.org - Modify the Request/Response data
- Verify the HTTPBin Body that the Request is updated by Breakpoint
- Verify the Response to verify the Header, Status Code, and body is updated by Breakpoint
Unit Test cases: Continue logic
1: Request Breakpoint on GET - HTTPS - Update Query Tab
Given:
- Create a Breakpoint Rule (Request Only)
- Make a GET https://httpbin.org/get Request
- Modify the Header and Query tab.
Expected:
- New Header and Query are in the Response Body
2: Request Breakpoint on GET - HTTPS - Update query from URL
Given:
- Create a Breakpoint Rule (Request Only)
- Make a GET https://httpbin.org/get Request, Modify the Header, and Query from the URL, e.g
https://httpbin.org/get?id=123
Expected:
- New Header and Query are in the Response Body
3: Request Breakpoint on POST JSON
- Given: Make a POST httpbin.org Request, Modify the Header, and Query and JSON Body. Create a Breakpoint Rule (Request Only)
- Expected: New Header and Query and the body are in the Response Body
4: Request Breakpoint on POST Form - Update by Body Tab
- Given: Make a POST httpbin.org Request, Modify the Header, and Query and Form Body (in the Body Tab). Create a Breakpoint Rule (Request Only)
- Expected: New Header and Query and the body are in the Response Body
5: Request Breakpoint on POST Form - Update by Form Tab
- Given: Make a POST httpbin.org Request, Modify the Header, and Query and Form Body (in the Form Tab). Create a Breakpoint Rule (Request Only)
- Expected: New Header and Query and the body are in the Response Body
6: Request Breakpoint and change the Method and URL
- Given: Make a GET https://httpbin.org/get Request, Modify Method = POST, URL =
https://httpbin.org/post?id=123, add some JSON Body. Create a Breakpoint Rule (Request Only) - Expected: There is a Query (id=123), and URL = "https://httpbin.org/post?id=123" and the JSON Body are in the Response Body
7: Request Breakpoint - Change different URL
- Given: Make a GET httpbin.org Request => Update URL to
www.google.comCreate a Breakpoint Rule (Request Only) - Expected: The Response Body is not from httpbin.org, it's a google HTML