Follow-up from #5584
Currently the RetryPolicy has these two methods which are part of its implementation detail and being used in unit tests:
ShouldRetryOnResponse
ShouldRetryOnTransportFailure
|
protected: |
|
virtual bool ShouldRetryOnTransportFailure( |
|
RetryOptions const& retryOptions, |
|
int32_t attempt, |
|
std::chrono::milliseconds& retryAfter, |
|
double jitterFactor = -1) const; |
|
|
|
virtual bool ShouldRetryOnResponse( |
|
RawResponse const& response, |
|
RetryOptions const& retryOptions, |
|
int32_t attempt, |
|
std::chrono::milliseconds& retryAfter, |
|
double jitterFactor = -1) const; |
These methods don't need to be virtual nor are they part of the public surface area. However, the way the tests are written, they take a dependency on this implementation detail. Additionally, because the unit tests have them mocked, they have to be marked as virtual, which they shouldn't be.
|
protected: |
|
bool ShouldRetryOnTransportFailure( |
|
RetryOptions const& retryOptions, |
|
int32_t attempt, |
|
std::chrono::milliseconds& retryAfter, |
|
double jitterFactor) const override |
|
{ |
|
return m_shouldRetryOnTransportFailure(retryOptions, attempt, retryAfter, jitterFactor); |
|
} |
|
|
|
bool ShouldRetryOnResponse( |
|
RawResponse const& response, |
|
RetryOptions const& retryOptions, |
|
int32_t attempt, |
|
std::chrono::milliseconds& retryAfter, |
|
double jitterFactor) const override |
|
{ |
|
return m_shouldRetryOnResponse(response, retryOptions, attempt, retryAfter, jitterFactor); |
|
} |
|
}; |
Follow-up from #5584
Currently the
RetryPolicyhas these two methods which are part of its implementation detail and being used in unit tests:ShouldRetryOnResponseShouldRetryOnTransportFailureazure-sdk-for-cpp/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp
Lines 405 to 417 in ac68505
These methods don't need to be virtual nor are they part of the public surface area. However, the way the tests are written, they take a dependency on this implementation detail. Additionally, because the unit tests have them mocked, they have to be marked as virtual, which they shouldn't be.
azure-sdk-for-cpp/sdk/core/azure-core/test/ut/retry_policy_test.cpp
Lines 107 to 126 in ac68505