[TASK] Refactor trustline test code

Refactor trustline test code to reduce duplication and check response body before status code and headers
I think the same best practices apply to both application code and testing code. For example, my previous task was to move the body checks before the status code and header checks. In the original format I would have to touch every test block to make that change, or if I wanted to add another check etc. Also, having the code duplicated makes it less clear what is actually changing from test to test. By having default values we can emphasize the parameters that are changed in each test, avoiding manual comparison. And reducing duplicated code makes it easier to focus on the abstraction layer that you are currently concerned with.