[TASK] Refactor trustline test code

Refactor trustline test code to reduce duplication and check response body before status code and headers