Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Functional Test Tree for Thalia's HTTP-level (aka REST) API

Overview

What is this?

It's a followon to the Functional Test Plan for the Thalia API provided by Questcon. In essence, it's a rundown of the calls described by the Thalia API document along with a listing of possible success and failure states.

...

Division is by applicable resource(s) and matches the function's URL: library/libraries, authorization(s), category/categories (tagging), item(s), map(s), and user(s). Each URL can use one or more of the GET, POST, PUT, and DELETE methods.

Functions on a library:

GET <baseurl>/library/<library id>, <baseurl>/library/<library id>/items, <baseurl>/library
Success states: library information, library item information, or default library information returned
Failure states: library doesn't exist, node id not library, access denied

...

PUT base/uri/library/<library id>
Success state: library modified
Failure states: no library ID provided, missing or malformatted input xml, missing library title, guest not allowed to modify, library ID does not exist, library ID not a library, library ID is the Public library, permission denied

Functions on libraries:

GET <baseurl>/libraries, <baseurl>/libraries/all
Success states: information on all visible libraries (optionall including items within) is returned
Failure states: not specified (impossible?)
Authorization functions:

Functions on an authz (authorization):

GET <baseurl>/authz/role/<role name>/qualifier/<qualifier id>
Success state: true/false permission check returned
Failure states: missing qualifier or role, incorrect role

...

POST <baseurl>/authz
Success state: authorization created
Failure states: empty/malformatted xml, guest not allowed, information missing from authz triplet, invalid role, invalid qualifier, qualifier not library/collection/slideshow

Functions on authzs (authorizations):

GET <baseurl>/authzs/functions, <baseurl>/authzs/qualifier/<qualifier id>, <baseurl>/authzs/qualifier/<qualifier id>/user/<username>
Success states: return all available functions, all authorizations on a specific library/collection/slideshow, or all authorizations on a specific library/collection/slideshow filtered by username
Failure states: none specified

Functions on a category or categories (tagging):

GET <baseurl>/categories, <baseurl>/categories/category/<category id>, <baseurl>/categories/item/<item id>
Success states: retreive all categories, all subcategories within a category, or all categories applied to the specified item
Failure states: missing item ID, item ID does not exist, item id not an item

...

DELETE <baseurl>/category/<category id>/item/<item id>
Success state: delete a category tag
Failure states: guest not allowed, item ID does not exist, item ID not an item, permission denied, tag not on item

Functions on an item:

GET <baseurl>/item/<item id>, <baseurl>/item/<item id>/download
Success states: information about item or item itself retreived
Failure states: no item provided, item does not exist, item ID not an item, permission denied

...

DELETE <baseurl>/item/<item id>, <baseurl>/item
Success state: item or items deleted
Failure states: no item ID in URL or xml, guest not allowed, item ID does not exist, item ID not an item, permission denied

Functions on items:

GET <baseurl>/items/library/<library id>
Success state: all items in library retreived
Failure states: invalid URL syntax, library ID missing, library ID does not exist, library ID not a library

GET <baseurl>/items/category/<categoryid>
Success state: all items tagged with a category retreived
Failure states: invalid URL syntax, category ID not specified, category does not exist, category ID not a category

Functions on a map:

GET <baseurl>/map/<map id>
Success state: gets information about the specified map
Failure states: map not specified, map ID does not exist, map ID not a map, access denied

...

PUT <baseurl>/map/<map id>
Success state: map modified
Failure states: guest not allowed, no map ID provided, bad xml, title/type missing, map ID does not exist, map ID not a map, access denied

Functions on maps:

GET <baseurl>/maps/collection, <baseurl>/maps/slideshow, <baseurl>/maps/savedsearch
Success state: maps of the corresponding type are returned
Failure state: unknown map type

GET <baseurl>/maps/item/<item id>
Success state: fetch all maps that reference an item
Failure state: not specified (presumably usual item info fetch errors apply)

Functions on a user:

GET <baseurl>/user/<username>
Success state: user information retreived
Failure states: no username, guest not allowed, user does not exist

...

DELETE <baseurl>/user/<username>
Success state: user deleted
Failure states: missing username, permission denied, user does not exist

Functions on users:

GET <baseurl>/users
Success state: all users in domain retreived
Failure state: guest not allowed