Filed under: easymock

ASM is not my friend

I am currently working on cleaning up our unit tests at work. Our service code calls several other services within the company. However, we don't necessarily want those called during the unit tests. Development-level services are notoriously unreliable. I have started using EasyMock 2.3 to mock the interfaces for our dependencies. However, some of the things we need to do require mocking classes. Enter EasyMock Class Extensions 2.3.

I first tried to use the class extensions and immediately got a NoSuchMethodError when running my tests. To make a long (and painful) story short, Hibernate imports a version of ASM that is newer than the one used by EasyMock Class Extensions. Luckily, the particular package I\'m using doesn't need Hibernate. It only gets included in the classpath because it is in the list of transitive dependencies. However, once I start using Hibernate, I fear it will not work. I will be trying this out today. If anyone has any ideas, though, please let me know.

web
stats