コード例 #1
0
 public MockHandler getHandler(Object mock) {
   if (!(mock instanceof Factory)) {
     return null;
   }
   Factory factory = (Factory) mock;
   Callback callback = factory.getCallback(0);
   if (!(callback instanceof MethodInterceptorFilter)) {
     return null;
   }
   return ((MethodInterceptorFilter) callback).getHandler();
 }
コード例 #2
0
 public void resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) {
   ((Factory) mock)
       .setCallback(0, new MethodInterceptorForGroovyFilter(cast(newHandler), settings));
 }