hemantk-12 commented on code in PR #4695:
URL: https://github.com/apache/ozone/pull/4695#discussion_r1199435344
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis_snapshot/OmRatisSnapshotProvider.java:
##########
@@ -76,7 +81,7 @@ public class OmRatisSnapshotProvider extends
RDBSnapshotProvider {
private final Map<String, OMNodeDetails> peerNodesMap;
private final HttpConfig.Policy httpPolicy;
private final boolean spnegoEnabled;
- private final URLConnectionFactory connectionFactory;
+ private URLConnectionFactory connectionFactory;
Review Comment:
> When possible, I prefer not to remove the final modifier just to make
tests work. Could we change the setConnectionFactory() to a
getConnectionFactory() method, and mock that method in the test?
+1 on using final.
Don't have very strong opinion but I think it would be nicer to pass
`URLConnectionFactory` as constructor parameter to achieve deterministic
behavior for testing. Also aligns with Dependency injection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]