API Integration Testing Plan
All tests must validate the returned JSON format and Object format.
Expected format includes checking that:
- The JSON format is valid
- The appropriate plurality is returned ( a single object vs an array of objects )
- The expected components for each Object are available, and the ones that should not be are not
- Objects with children have the expected children ( e.g. Events have all the Services )
- The children are delivered in an expected and valid JSON format
- Do not validate the children’s Object format, do that in the tests for the children Objects ( e.g. don’t bother worrying about what a Service has or looks like when you’re testing Events, only check that the correct Services are there, probably by ID. Do the validation of Services when you’re testing Services! )
POST api/events
- Create a new Event
GET api/events
- List all Events
GET api/events/{event}
- List a single, specified Event, validate it is the correct Event by ID
PUT,PATCH api/events/{event}
- Update a single, specified Event, validate the update is correct and stored
DELETE api/events/{event}
- Delete a single, specified Event, validate that:
- Only that Event was deleted and not the Services or ServiceTags associated with it
- No other Events were deleted
GET api/events/{event}/services
- Get the Services attached to an Event, validate that:
- the correct Services were retrieved by IDs
- the correct number of Services are retrieved
POST api/events/{event}/services/{service}
- Add a known Service to an Event, validate that:
- the correct Service was added by ID
- only the correct Service was added
DELETE api/events/{event}/services/{service}
- Remove a Service from an Event, validate that:
- the correct Service was removed
- only the correct Service was removed
POST api/services
- Create a new Service
GET api/services
- List all Services
GET api/services/{service}
- List a single, specified Service, validate it is the correct Service by ID
PUT,PATCH api/services/{service}
- Update a single, specified Service, validate the update is correct and stored
DELETE api/services/{service}
- Delete a single, specified Service, validate that:
- Only that Service was deleted and not the ServiceTags associated with it
- No other Services were deleted
GET api/services/{service}/service_tags
- Get the ServiceTags attached to a Service, validate that:
- the correct ServiceTags were retrieved by IDs
- the correct number of ServiceTags are retrieved
POST api/services/{service}/service_tags/{service_tag}
- Add a known ServiceTag to a Service, validate that:
- the correct ServiceTag was added by ID
- only the correct ServiceTag was added
DELETE api/services/{service}/service_tags/{service_tag}
- Remove a ServiceTag from a Service, validate that:
- the correct ServiceTag was removed
- only the correct ServiceTag was removed
POST api/service_tags
- Create a new ServiceTag
GET api/service_tags
- List all ServiceTags
GET api/service_tags/{service_tag}
- List a single, specified ServiceTag, validate it is the correct ServiceTag by ID
PUT,PATCH api/service_tags/{service_tag}
- Update a single, specified ServiceTag, validate the update is correct and stored
DELETE api/service_tags/{service_tag}
- Delete a single, specified ServiceTag, validate that:
- No other ServiceTags were deleted
GET /api/events?order-by=<column_name>&order=<ASC|DESC>
- Default order test
- Alternate order test
GET /api/services?order-by=<column_name>&order=<ASC|DESC>
- Default order test
- Alternate order test
GET /api/service_tags?order-by=<column_name>&order=<ASC|DESC>
- Default order test
- Alternate order test
GET /api/services?filter-ids=<id>
- Single service test
- Multiple service test
- Empty test
GET /api/service_tags?filter-ids=<ids>
- Single serviceTag test
- Multiple serviceTags test
- Empty test
GET /api/services?filter-except-ids=<ids>
- Single service filtered out test
- Multiple services filtered out test
- Empty test
GET /api/service_tags?filter-except-ids=<ids>
- Single serviceTag filtered out test
- Multiple serviceTags filtered out test
- Empty test
GET /api/services?filter-tag-ids=<ids>
- Single service by serviceTag test
- Multiple services by serviceTag test
- Empty test
- Any API, apply two or more filters and validate results
GET /api/events/{event}/services?filter-ids=<ids>
- Filter by ID test
- Filter by except ID test
- Filter by ID of serviceTag test
- Ordering test
GET /api/services/{service}/service_tags?filter-ids=<ids>
- Filter by ID test
- Filter by except ID test
- Ordering test