Scripted tests for REST end-points. Code was largely copied from RestServiceFilesIT. Difference is that this version finds files with the suffix ".script" and executes the command stream located in them. Commands are:
GET address DELETE address QUERY query EXPLAIN query POST address content PUT address content PATCH address content EQUALS expected CONTAINS expected JSONEQ expected HEADERS expected EMPTY NOTEMPTY SHOW DEBUG
where address is a path relative the resource end-point, content is a string value that is converted to bytes and sent with POST, PUT and PATCH operations, and expected is a value used in comparison with the most recently returned content. The values of the query, content and expected fields may be specified in-line, or as a reference to another file as in @filename. For in-line values, the character sequences "\n", "\t" and "\r" are converted to the corresponding new-line, tab and return characters. This transformation is not done if the value is supplied as a file reference. An empty string can be specified as simply @, e.g.:
POST /builder/implode/test.customers @
The SHOW and DEBUG commands are useful for debugging. SHOW simply prints out the actual content of the last REST response. The DEBUG command calls the static method {@link #debug(int)}. You can set a debugger breakpoint inside that method.
@author peter