*
* @param f The field to be mocked
* @return The type to actually mock
*/
static Class<?> getTypeToMock(Field f) {
GwtFactory gwtFactory = GwtFactory.get();
if (gwtFactory != null && gwtFactory.getOverlayRewriter() != null
&& gwtFactory.getOverlayRewriter().isJsoIntf(f.getType().getName())) {
try {
return Class.forName(JsValueGlue.JSO_IMPL_CLASS);
} catch (ClassNotFoundException e) {
// should never happen
throw new GwtTestPatchException("Error while creating a mock with Mockito for "