Skip to content

Resolve "Refactor ProductsCreatedAfterClient"

Closes #168 (closed)

This PR refactors the ProductsCreatedAfterClient class to remove the custom async executor in favor of java's HttpClient.

In addition it adds a retry mechanism to retry up to a static number of times (non configurable but can be if we feel its necessary), and adds a timeout for each request (non configurable but can be if we feel we want it).

For testing it removes a MockProductsCreatedAfterClient class used to test the AwsProductReceiver which was used to mock the real class in the AwsProductReceiverTest test cases. I think this change makes it quite a bit better because we are testing the real class with mocked objects (really just HttpClient) rather than an inherited subclass of it that added modified delays and wasn't using the superclass methods.

Unrelated to this ticket some tests in WebSocketAwsProductReceiverTest were sporadically failing due to the tests relying on timings of when things run. I did a band aid fix on that for now and should address that in another scope of work #181.

I also noticed some slowness in the /products_created_after endpoint so created another story in the infrastructure repo: https://code.chs.usgs.gov/ghsc/hazdev/cdk/anss-pdl/-/issues/252

Merge request reports

Loading