Menu

#47 reject .andReturn then expectLastCall

open
nobody
None
5
2012-10-05
2012-04-11
Roger Pack
No

It seems from first glance that this should "not be allowed"

expect(something.something).andReturn(null)
expectLastCall().andThrow(something).

I would have expected this to raise an easy mock "can't do that!" error since I already defined the last call. Maybe force them to use expectLastCallAgain() (since they already defined return for it once).

Discussion

  • Roger Pack

    Roger Pack - 2012-04-11

    for instance:

    expect(emSession.createProducer(emQueue)).andReturn(emMessageProducer).andThrow(new JMSException("you failed! failed!"));

    seems odd to allow.

     
  • Henri Tremblay

    Henri Tremblay - 2012-04-11

    EasyMock has moved its issue tracking to Codehaus.

    Please report the current issue here: http://jira.codehaus.org/browse/EASYMOCK

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.