Tests: use custom QNAM to intercept network requests


We have added m_testOperationPath and m_requestContent protected
variables to the generated client API classes is order to be able
to verify the data that we send to the server in our unit tests.

That, however, means that these variables will also exist in the
production code. Back then we could not find a different approach,
but apparently we can do better by creating a custom QNAM and
overriding the createRequest() method.
The method takes an original request and the outgoing data and
allows to modify it.
We do not need to do any modifications, but we can use the
original request and outgoing data to extract all the information
that is needed for the testing purposes.
After that we can pass the custom QNAM to a new QRestAccessManager,
and install this QRestAccessManager using
BaseApi::setRestAccessManager().

This patch adds custom LoggingNetworkAccessManager classes to
the relevant tests, which allows to remove the protected variables
from the generated classes.

Pick-to: 6.11
Change-Id: I498e0f966cef4d306ffade88f0a3dc3f5bcdf238
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitd9b2c21f458e9f9d42184d9cd6f838006730e2e3
parent04d20927b261603b07c07654febd035595ec4178
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 8 Jan 2026 10:50:15 +0100