Project Functional Testing


For purposes of this API description, all URLs are relative to the base url of http://localhost:8080/bn/api

The JSON used for testing purposes will match the format described in the project API.

Functional testing will begin only after the tester was able to build the project following your build instructions and then deploy the resulting .war file to a tomcat server. If your build scripts generate something else other than a .war file that's fine too, as long as the build & deploy instructions are clear and work as expected.

The specific actions taken by the tester before beginning functional acceptance testing are described here.

Values (in the expected response files) that are enclosed between angle brackets will be substituted with actual values we recorded in the previous testing steps. For example, if you see in the expected response "uid": "<uid1>" it means that the test will expect to see something like "uid": "79" when it runs, where 79 is the value that was returned in a previous response that we denoted as 'uid1'.

If you think that what you see below is a lot of testing, then you should consider the fact that we're just scratching the surface testing: for instance, we have very few tests that validate how your application responds to invalid data in the request, and only one test for submitting requests that violate application logic. In fact, all the tests below represent a pretty minimalistic set of tests.

Below are the steps we'll take to test the functionality of your project.

NOTE: the testers reserve the right to do more extensive testing than the tests below, by either adding more tests or by changing the request payloads.

Lastly, we are developing a Postman script that automates the testing of your project. The script performs the actions described in each test (GET, POST, PUT, DELETE), using the payload that needs to be submitted, as needed, and compares the output returned by your application with the expected output. Read more about how to run the script.

    Test 'accounts'

  1. Validate that there are exactly three accounts returned when the applicatin runs for the first time ( GET /accounts ).
    • The HTTP status should be 200 (OK).
    • Here is the expected response.
    • NOTE: the accounts with <uid0> and <uid1> are Regular User accounts. The account with <uid2> is a Customer Service Representative account. All three accounts will be used for testing.
    • NOTE: the actual values for 'date_created' will be those when the account are first created, that's the date when we test the project.
  2. Create an account ( POST /accounts ) using valid data.
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>.
    • View data for the POST.
    • Here is the expected response.
    • Retain <uid3> and <date3> for subsequent tests.
  3. Update the account identified by <uid3> ( PUT /accounts/<uid3> )
    • The HTTP status should be 204 (No content) and the body of the response empty.
    • View data for the PUT.
  4. Verify that account <uid3> has been updated properly, i.e. the name has been changed and date_created (returned as <date4>) is the same as <date3> ( GET /accounts/<uid3> ).
  5. Attempt to activate the account identified by <uid3> using PUT ( PUT /accounts/<uid3> ).
  6. Activate account <uid3> ( GET /accounts/<uid3>/activate ).
  7. View all accounts ( GET /accounts ).
  8. Search accounts ( GET /accounts?key=main ).
  9. Search accounts again with a different keyword ( GET /accounts?key=60616 ).
  10. Search accounts with a date range ( GET /accounts?key=60616&start_date=31-Dec-2000&end_date=31-Dec-2001 ).
  11. Test 'asks'

  12. Create ask ( POST /accounts/<uid3>/asks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>/asks/<aid1>
    • View data for the POST.
    • View the expected response.
    • Retain <aid1> and <date5> for subsequent tests.
  13. View ask <aid1> ( GET /asks/<aid1> )
  14. Update ask <aid1> ( PUT /accounts/<uid3>/asks/<aid1> ).
    • The HTTP status should be 204 (No content) and the body of the response empty.
    • View data for the PUT.
  15. Create ask ( POST /accounts/<uid3>/asks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>/asks/<aid2>
    • View data for the POST.
    • View the expected response.
    • Retain <aid2> and <date6> for subsequent tests.
  16. Create ask ( POST /accounts/<uid3>/asks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>/asks/<aid3>
    • View data for the POST.
    • View the expected response.
    • Retain <aid3> for subsequent tests.
  17. Deactivate <aid3> ( GET /accounts/<uid3>/asks/<aid3>/deactivate )
  18. View my asks ( GET /accounts/<uid3>/asks )
  19. View my active asks ( GET /accounts/<uid3>/asks?is_active=true )
  20. Delete ask <aid3> ( DELETE /accounts/<uid3>/asks/<aid3> )
    • Expected HTTP status: 204 (No content). Response body empty.
  21. Verify that ask <aid3> has been deleted ( GET /asks/<aid3> )
    • Expected HTTP status: 404 (Not Found).
  22. Create ask ( POST /accounts/<uid1>/asks ).
  23. Create ask ( POST /accounts/<uid0>/asks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid0>/asks/<aid5>
    • View data for the POST.
    • View the expected response.
    • Retain <aid5> for subsequent tests.
  24. Create an account ( POST /accounts ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid4>.
    • View data for the POST.
    • Here is the expected response.
    • Retain <uid4> for subsequent tests.
  25. Activate account <uid4> ( GET /accounts/<uid4>/activate ).
  26. Create ask ( POST /accounts/<uid4>/asks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid4>/asks/<aid6>
    • View data for the POST.
    • View the expected response.
    • Retain <aid6> for subsequent tests.
  27. View all asks ( GET /asks?v_by=<uid1>&is_active= ).
  28. View all asks ( GET /asks?v_by=<uid2>&is_active= ). NOTE: this request should return all asks, whether active or not, because <uid2> is a CSR.
  29. Test 'gives'

  30. Create an account ( POST /accounts ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid5>.
    • View data for the POST.
    • Here is the expected response.
    • Retain <uid5> for subsequent tests.
  31. Activate account <uid5> ( GET /accounts/<uid5>/activate ).
  32. Create give ( POST /accounts/<uid3>/gives ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>/gives/<gid1>
    • View data for the POST.
    • View the expected response.
    • Retain <gid1> for subsequent tests.
  33. Update <gid1> ( PUT /accounts/<uid3>/gives/<gid1> ).
    • The HTTP status should be 204 (No content) and the body of the response empty.
    • View data for the PUT.
  34. Verify that the <gid1> update is successful ( GET /gives/<gid1> ).
  35. Create give ( POST /accounts/<uid3>/gives ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid3>/gives/<gid2>
    • View data for the POST.
    • View the expected response.
    • Retain <gid2> for subsequent tests.
  36. Attempt to create give ( POST /accounts/<uid1>/gives ).
  37. Activate account <uid1> ( GET /accounts/<uid1>/activate ).
  38. Create give ( POST /accounts/<uid1>/gives ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid1>/gives/<gid3>
    • View data for the POST.
    • View the expected response.
    • Retain <gid3> for subsequent tests.
  39. Create give ( POST /accounts/<uid5>/gives ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid5>/gives/<gid4>
    • View data for the POST.
    • View the expected response.
    • Retain <gid4> for subsequent tests.
  40. Create give ( POST /accounts/<uid4>/gives ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid4>/gives/<gid5>
    • View data for the POST.
    • View the expected response.
    • Retain <gid5> for subsequent tests.
  41. Deactivate <gid3> ( GET /accounts/<uid1>/gives/<gid3>/deactivate )
  42. View my gives ( GET /accounts/<uid3>/gives )
  43. View my inactive gives ( GET /accounts/<uid3>/gives?is_active=false )
  44. View all gives ( GET /gives?v_by=<uid1>&is_active= ). NOTE: this request should return all gives visible to <uid1>, whether active or not, because <uid1> is a Regular User (RU).
  45. View all gives ( GET /gives?v_by=<uid2>&is_active= ). NOTE: this request should return all gives, whether active or not, because <uid2> is a CSR.
  46. View all active gives ( GET /gives?v_by=<uid2>&is_active=true ). NOTE: this request should return all active gives because <uid2> is a CSR.
  47. Test 'thanks'

  48. Create an account ( POST /accounts ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid6>.
    • View data for the POST.
    • Here is the expected response.
    • Retain <uid6> for subsequent tests.
  49. Activate account <uid6> ( GET /accounts/<uid6>/activate ).
  50. Create thank ( POST /accounts/<uid6>/thanks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid6>/thanks/<tid1>
    • View data for the POST.
    • View the expected response.
    • Retain <tid1> for subsequent tests.
  51. Create thank ( POST /accounts/<uid6>/thanks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid6>/thanks/<tid3>
    • View data for the POST.
    • View the expected response.
    • Retain <tid3> for subsequent tests.
  52. Create an account ( POST /accounts ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid7>.
    • View data for the POST.
    • Here is the expected response.
    • Retain <uid7> for subsequent tests.
  53. Activate account <uid7> ( GET /accounts/<uid7>/activate ).
  54. Create thank ( POST /accounts/<uid7>/thanks ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /accounts/<uid7>/thanks/<tid2>
    • View data for the POST.
    • View the expected response.
    • Retain <tid2> for subsequent tests.
  55. View my thanks ( GET /accounts/<uid6>/thanks )
  56. View thanks for user ( GET /thanks/received/<uid4> )
  57. Test 'notes'

  58. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid1>
    • View data for the POST.
    • View the expected response.
    • Retain <nid1> for subsequent tests.
  59. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid2>
    • View data for the POST.
    • View the expected response.
    • Retain <nid2> for subsequent tests.
  60. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid3>
    • View data for the POST.
    • View the expected response.
    • Retain <nid3> for subsequent tests.
  61. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid4>
    • View data for the POST.
    • View the expected response.
    • Retain <nid4> for subsequent tests.
  62. Update note ( PUT /notes/<nid3> ).
    • The HTTP status should be 204 (No content) and the body of the response empty.
    • View data for the PUT.
  63. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid5>
    • View data for the POST.
    • View the expected response.
    • Retain <nid5> for subsequent tests.
  64. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid6>
    • View data for the POST.
    • View the expected response.
    • Retain <nid6> for subsequent tests.
  65. Create note ( POST /notes ).
    • The request should return 201 (Created) and the HTTP header should contain a 'Location' link to /notes/<nid7>
    • View data for the POST.
    • View the expected response.
    • Retain <nid7> for subsequent tests.
  66. View all notes organized as conversation threads ( GET /notes ).
  67. View all notes created by <uid3> and visible to <uid7> ( GET /notes?c_by=<uid3>&v_by=<uid7>&type=&agid= ).
  68. View all notes visible to <uid7> ( GET /notes?c_by=&v_by=<uid7>&type=&agid= ).
  69. Test 'reports'

  70. View available reports ( GET /reports ).
  71. Get report <rid1> viewed by <uid2> ( GET /reports/<rid1>?c_by=&v_by=<uid2>&start_date=&end_date= ). NOTE: The response must include all asks and gives created since the value of 'c_by' is empty, the value of 'v_by' identifies a CSR user, and no values are specified for start_date and end_date.
  72. Get report <rid2> viewed by <uid2> ( GET /reports/<rid2>?c_by=<uid4>&v_by=<uid2>&start_date=&end_date= ). NOTE: The response must include all asks and gives created by <uid4>&, and all related communications since the value of 'v_by' identifies a CSR user, and no values are specified for start_date and end_date.
  73. Get report <rid2> viewed by <uid2> with dates ( GET /reports/<rid2>?c_by=&v_by=<uid2>&start_date=1-Jan-2122&end_date=31-Dec-2122 ). NOTE: The response must include all asks and gives created by all users and all related communications since the value of 'v_by' identifies a CSR user, between 1-Jan-2122 and 31-Dec-2122.
  74. Varia

  75. Delete ask <aid2> ( DELETE /accounts/<uid3>/asks/<aid2> ).
    • Expected HTTP status: 204 (No content). Response body empty.
  76. Verify that the ask <aid2> has been removed ( GET /asks/<aid2> ).
    • Expected HTTP status: 404 (Not Found).
  77. Verify that the conversation associated with ask <aid2> has been removed ( GET /notes?c_by=&v_by=<uid2>&type=ask&agid=<aid2> ).
    • Expected HTTP status: 404 (Not Found).
  78. Search notes ( GET /notes?key=Ikea ).

Last update: Apr 5, 2022 Virgil Bistriceanu cs445 Computer Science