I want to use the RestAssured framework to test my Java Spring API. The way the API works is that you have to login using a POST to /session/login with a username and a password in JSON format, for example:
{"username":"testuser","password":"testpassword"}
If the username and password are correct, a session cookie is returned which can then be used to determine whether the user is logged in. I can't seem to find a way to use the RestAssured's auth() function to do this. How would I do this?