Results 1 to 8 of 8
Thread: junit test case error
- 07-12-2011, 09:22 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
junit test case error
i am learning junit test cases.when i tried to run junit test case i got this error: "java.lang.IllegalStateException: no last call on a mock available" below is the code.
@Before
public void setUp(){
DaoImpl.SetService(mock(Service.class));
}
@Test
public void testGetis() {
ServiceProcessResponse response = new ServiceProcessResponse();
response.setStatus("S");
response.setError(null);
ServiceProcessRequest request=new ServiceProcessRequest();
request.setEmailAddress("11");
request.setOrderNumber("123");
expect(DaoImpl.getService().process(
request, null, null)).andReturn(response);
replay(promotionDaoImpl);
DaoImpl.data(anyString(),anyBoolean(), anyBoolean());
verify(DaoImpl);
}
i am getting error at "expect" statement line.
here when i say return(response) ,it s returning null instead of what i have defined.
can any one help on this please.
- 07-12-2011, 09:54 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Why post this in two places?
Was your other thread not good enough?
- 07-12-2011, 10:29 AM #3
Member
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
that's different one.so removed it and made a new post.
- 07-12-2011, 11:00 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Looks the same to me...
- 07-12-2011, 11:07 AM #5
Member
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
can i get any suggestions for my query.I am looking for it.
- 07-12-2011, 11:43 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Maybe if you answer the questions I left on the other thread, since they apply here as well...
- 07-12-2011, 01:09 PM #7
Member
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
i have posted details to that thread.
- 07-12-2011, 01:13 PM #8
I suggest sticking/merging your two threads because its a little confusing to the people that are trying to help you when you refer to other threads without links in your posts.
- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
Similar Threads
-
JUnit test - AssertEquals
By dellacpa in forum New To JavaReplies: 2Last Post: 11-21-2010, 09:19 PM -
junit test problem
By moamen in forum EclipseReplies: 2Last Post: 03-14-2010, 09:41 PM -
JUnit Test??? What is it all about????? Please help!!
By nikosa in forum New To JavaReplies: 1Last Post: 08-03-2009, 05:31 PM -
JUnit Test Help!
By pharo in forum New To JavaReplies: 0Last Post: 04-10-2009, 05:15 PM -
Junit test
By alice in forum New To JavaReplies: 1Last Post: 06-14-2008, 01:24 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks