demery-pivotal commented on a change in pull request #7299:
URL: https://github.com/apache/geode/pull/7299#discussion_r792077305



##########
File path: 
geode-serialization/src/test/java/org/apache/geode/internal/serialization/filter/ReflectiveFacadeGlobalSerialFilterFactoryTest.java
##########
@@ -41,8 +49,9 @@ public void constructsDelegatingGlobalSerialFilter() {
   public void delegatesToObjectInputFilterApiToCreateObjectInputFilter()
       throws InvocationTargetException, IllegalAccessException {
     ObjectInputFilterApi api = mock(ObjectInputFilterApi.class);
-    GlobalSerialFilterFactory factory = new 
ReflectiveFacadeGlobalSerialFilterFactory(api);
-    GlobalSerialFilter filter = factory.create("pattern", emptySet());
+    ReflectiveFacadeGlobalSerialFilterFactory factory =
+        new ReflectiveFacadeGlobalSerialFilterFactory();
+    GlobalSerialFilter filter = factory.create(api, "pattern", emptySet());

Review comment:
       This tests an implementation detail, and leaves the actual 
responsibility (invoked via the other `create()` method) untested.
   
   My sense is that it's just as easy to pass the api through the constructor, 
and that there's no harm making that constructor visible for even non-test 
code. Even if you want to restrict that constructor only to tests, invoking the 
real `create()` here exercises the responsibility more fully (everything except 
supplying the api used in production).




-- 
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]


Reply via email to