This is the project I developed as part of my REST API testing training to become a Java QA Automation Engineer within the company.
- Programming language -
Java - Build and project management tool -
Maven - Testing framework -
JUnit 5 - Request handling -
Apache HTTP Client&Rest Assured - Reporting framework -
Allure - Integration -
Docker
During the training, will test the provided web-service from Docker container. All requirements for the web-service must work properly only for one-thread execution. Web-service handles storage of users and their information: name, age, sex and zip code.
Application provides:
- information about all stored users;
- possibility to create, update, delete users;
- information about available zip codes;
- possibility to add new zip codes.
- Go to
http://localhost:<port>/swagger-ui/and read information about all endpoints. - Create Maven project with the dependencies needed.
- Develop client code to get bearer tokens with read and write scopes separately.
- No tests should be developed for this task
- when I send
POST requestto/oauth/token - and I put parameters
grant_type=client_credentialsandscope=write - and I set username and password for
basic auth - then I get
responsewithbearer token, which works for anyPOST, PUT, PATCH, DELETEmethods of web-service
- when I send
POST requestto/oauth/token - and I put parameters
grant_type=client_credentialsandscope=read - and I set username and password for
basic auth - then I get
responsewithbearer token, which works for anyGETmethods of web-service
Write tests to cover requirements for zip codes functionality
- Given I am authorized user
- When I send
GETrequest to/zip-codesendpoint - Then I get
200response code - And I get all available zip codes in the application for now
- Given I am authorized user
- When I send
POSTrequest to/zip-codes/expandendpoint - And Request body contains list of zip codes
- Then I get
201response code - And zip codes from request body are added to available zip codes of application
- Given I am authorized user
- When I send
POSTrequest to/zip-codes/expandendpoint - And Request body contains list of zip codes
- And list of zip codes has duplications for available zip codes
- Then I get
201response code - And zip codes from request body are added to available zip codes of application without duplicates
- Given I am authorized user
- When I send
POSTrequest to/zip-codes/expandendpoint - And Request body contains list of zip codes
- And list of zip codes has duplications of already used zip codes
- Then I get
201response code - And zip codes from request body are added to available zip codes of application without duplicates
Write tests to cover requirements for user creation functionality
- Given I am authorized user
- When I send
POSTrequest to/usersendpoint - And Request body contains user to add
- And all fields are filled in
- Then I get
201response code - And User is added to application
- And Zip code is removed from available zip codes of application
- Given I am authorized user
- When I send
POSTrequest to/usersendpoint - And Request body contains user to add
- And only required fields are filled in
- Then I get
201response code - And User is added to application`
- Given I am authorized user
- When I send
POSTrequest to/usersendpoint - And Request body contains user to add
- And all fields are filled in
- And Zip code is incorrect (unavailable)
- Then I get
424response code - And User is NOT added to application
- Given I am authorized user
- When I send
POSTrequest to/usersendpoint - And Request body contains user to add with same name and sex as existing user
- Then I get
400response code - And User is NOT added to application
Write tests to cover requirements for user filtering
- Given I am authorized user
- When I send
GETrequest to/usersendpoint - Then I get
200response code - And I get all users stored in the application for now
- Given I am authorized user
- When I send
GETrequest to/usersendpoint - And I add
olderThanparameter - Then I get
200response code - And I get all users older than parameter value
- Given I am authorized user
- When I send
GETrequest to/usersendpoint - And I add
youngerThanparameter - Then I get
200response code - And I get all users younger than parameter value
- Given I am authorized user
- When I send
GETrequest to/usersendpoint - And I add
sexparameter - Then I get
200response code - And I get all users with sex equal to parameter value
Write tests to cover requirements for updating user functionality
- Given I am authorized user
- When I send
PUT/PATCHrequest to/usersendpoint - And Request body contains user to update and new values
- Then I get
200response code - And User is updated
- Given I am authorized user
- When I send
PUT/PATCHrequest to/usersendpoint - And Request body contains user to update and new values
- And new zip code is incorrect (unavailable)
- Then I get
424response code - And User is NOT updated
- Given I am authorized user
- When I send
PUT/PATCHrequest to/usersendpoint - And Request body contains user to update and new values
- And Required fields are not filled in
- Then I get
409response code - And User is NOT updated
Write tests to cover requirements for deleting user functionality
- Given I am authorized user
- When I send
DELETErequest to/usersendpoint - And Request body contains user to delete
- Then I get
204response code - And User is deleted
- And its zip code is returned in list of available zip codes
- Given I am authorized user
- When I send
DELETErequest to/usersendpoint - And Request body contains user to delete (required fields only)
- Then I get
204response code - And User is deleted
- And its zip code is returned in list of available zip codes
- Given I am authorized user
- When I send
DELETErequest to/usersendpoint - And Request body contains user to delete (any required field not filled)
- Then I get
409response code - And User is deleted
Write tests to cover requirements for uploading user functionality
- Given I am authorized user
- When I send
POSTrequest to/users/uploadendpoint - And Request body contains
JSON filewith array of users to upload - Then I get
201response code - And all users are replaced with users from file
- And Response contains number of uploaded users
- Given I am authorized user
- When I send
POSTrequest to/users/uploadendpoint - And Request body contains
JSON filewith array of users to upload - And at least 1 user has incorrect (unavailable) zip code
- Then I get
424response code - And Users are NOT uploaded
- Given I am authorized user
- When I send
POSTrequest to/users/uploadendpoint - And Request body contains
JSON filewith array of users to upload - And at least 1 user has a required field not filled
- Then I get
409response code - And Users are NOT uploaded
- Add
Allure Frameworkto the project - Add payload to tests in the report if required
- Add
@Stepannotation for better readability of the report - Mark tests with bugs with corresponding Allure annotation
- Pull one more docker image (containing improved web-service) and start the container
- Execute all tests in project with
Apache HTTP Client - Execute all tests in project with
Rest Assured Framework - Make sure ALL tests are passed