V
vysh
Hi everyone,
I am using EasyMock in my junit testcases.But it
is giving an exception, which I failed to resolve.
This is my code
------------------------
SOAPHeader unsubHead =
currCntxt.getMessage().getSOAPHeader();
Here currCntxt is a MessageContext object.I need to expect this
particular method.
My test class contains this code.
MessageContext currCntxt =
EasyMock.createMock(MessageContext.class);
SOAPHeader sphead =
EasyMock.createMock(SOAPHeader.class);
EasyMock.expect(currCntxt.getMessage().getSOAPHeader()).andReturn(sphead).once();
replay(currCntxt);
replay(sphead);
but its giving the follwing exception.
Caused an ERROR
0 matchers expected, 1 recorded.
java.lang.IllegalStateException: 0 matchers expected, 1 recorded.
at
org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:
42)
at
org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:
34)
at
org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:
26)
at org.easymock.internal.RecordState.invoke(RecordState.java:64)
at
org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:
24)
at
org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:
56)
It would me helpful if anyone could put some lights on the issue.
thanks,
vysh
I am using EasyMock in my junit testcases.But it
is giving an exception, which I failed to resolve.
This is my code
------------------------
SOAPHeader unsubHead =
currCntxt.getMessage().getSOAPHeader();
Here currCntxt is a MessageContext object.I need to expect this
particular method.
My test class contains this code.
MessageContext currCntxt =
EasyMock.createMock(MessageContext.class);
SOAPHeader sphead =
EasyMock.createMock(SOAPHeader.class);
EasyMock.expect(currCntxt.getMessage().getSOAPHeader()).andReturn(sphead).once();
replay(currCntxt);
replay(sphead);
but its giving the follwing exception.
Caused an ERROR
0 matchers expected, 1 recorded.
java.lang.IllegalStateException: 0 matchers expected, 1 recorded.
at
org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:
42)
at
org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:
34)
at
org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:
26)
at org.easymock.internal.RecordState.invoke(RecordState.java:64)
at
org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:
24)
at
org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:
56)
It would me helpful if anyone could put some lights on the issue.
thanks,
vysh