Purpose: Building a Report Engine and I have multiple service calls:
Problem: While testing my report engine, I would like to run the report that needs all three services. Unfortunately, I need to inject the mocked applications from service one (1) into service three (3) or cache the mocked results for use. Otherwise, the random IDs generated during the MockedApplications Service do not match those of the Mocked Responses Service (which calls the Former to iterate and generate mocked responses). However, if I create a method that takes an injected set of applications, it is not correctly implementing the basic service.
Posted on zulip here.
Any thoughts on how to accurately set up this test scenario?
Kindest Regards!
Attempted to Cache Mocked Service Method
@Mock
@ApplicationScoped
@CacheResult(cacheName = "mock-streams")
public class MockStreamsResource extends StreamsResource {
...
However, this did not work. While there were no errors, it did not re-use the applications from the initial call while running the third (which, also mocked, calls the first mocked and second mocked services.)
Instead of randomly generating the discriminating ID during the Application Service, I used an available pool of UUIDs. This made each test predictable and repeatable.
Therefore, when the Mocked Service that generates answers calls the Application Service, it will match the results on the account_id for both the application and response.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.