Functional automation for API testing. Write a test in Java for the following REST API:
https://jsonplaceholder.typicode.com/
Requirements:
- Get a random user (userID), print out its email address to console.
- Using this userID, get this user’s associated posts and verify they contains a valid Post IDs (an Integer between 1 and 100).
- Do a post using same userID with a non-empty title and body, verify the correct response is returned (since this is a mock API, it might not return Response code 200, so check the documentation).
On average, this task can be completed in 2-3 hours, but you are welcome to spend more time on it to submit a better quality code.