• Post Reply Bookmark Topic Watch Topic
  • New Topic

EasyMock: createMock without mocked methods  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'd like to rewrite my jUnit test to EasyMock. Here is a dummy code snippet:



SomeObject is configured using Attribute1 and Attribute2. I want to test object.doSomethingDependingOn1And2() method call, which makes use of both attributes. Now, let's take a look on EasyMock classextension version:



In createMock call i specify which methods should be mocked. EasyMock does not overwrite object.doSomethingDependingOn1And2() behaviour. It works, but i'll never use this code in my project. Why ? Because of:



It is refactoring unsafe. When i change the name of the attribut1, i'll have to change test case. Is it somehow possible to createMock(), which does not overwrite class behaviour ?

Wish code. expect overtakes method mocking



Thanks, Lukasz
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!