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(); }
public void resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) { ((Factory) mock) .setCallback(0, new MethodInterceptorForGroovyFilter(cast(newHandler), settings)); }