Skip to content

Commit 65ab70a

Browse files
author
j.schmied@pay-co.net
committed
Fix assertion in ValueBox.<init>
1 parent e0e368a commit 65ab70a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gwtmockito/src/main/java/com/google/gwtmockito/impl/ReturnsCustomMocks.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.google.gwt.core.client.JavaScriptObject;
1919
import com.google.gwt.dom.client.Element;
20+
import com.google.gwt.dom.client.InputElement;
2021

2122
import org.mockito.internal.stubbing.defaultanswers.ReturnsMocks;
2223
import org.mockito.invocation.InvocationOnMock;
@@ -42,6 +43,8 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
4243
} else if (invocation.getMock() instanceof Element && methodName.equals("getTagName")) {
4344
String className = invocation.getMock().getClass().getSimpleName();
4445
return className.substring(0, className.indexOf("Element")).toLowerCase();
46+
} else if (invocation.getMock() instanceof InputElement && methodName.equals("getType")) {
47+
return "text";
4548
} else {
4649
return super.answer(invocation);
4750
}

0 commit comments

Comments
 (0)