Problems arise from the fact that the are two kind of successful
responses: The array of objects response like
{"key":[{obj1},{obj2},...]} and the single object response like
{"key":{obj}}. The function will try to check if the response can be
unmarshaled in an array of generic type variables so to match the
first case. If not it will try to unmarshal to a single generic type
variable and 1 will be returned as the length of the response. If
this will also fail -1 will be returned.
- The function must return the token and an error (string, error).
In case of an error the token is going to be an empty string. The
assertion for the error __must__ be executed in the body of the
test. The utility functions __must not__ panic. All of the tests
must use this function in the future.
- NewTestEndpoint() should replace TestEndpoint() since it is
returning an error in case that the code or the response is not
matching the expected one. The assertion __must__ be executed in the
body of the actual test (of the corresponding package) so the
printed error message can include the right number of line and the
file where the assertion failed.
- The function is used now only in package scenario tests.
- Typedefs the name of a model (ModelName) and the CRUD operations
(CRUD).
- Defines constants for models's names and the 4 CRUD operations
- Changes the corresponding functions that need to validate the role