Top "Easymock" questions

Easymock is a mocking framework for Java.

PowerMock LinkageError: MockClassLoader javax/management/MBeanServer

I'm seeing the following PowerMock/EasyMock error with the following JARS: Jars activemq-all-5.9.0.jar com.ibm.mq.headers-7.0.1.5.jar com.…

java junit jar easymock powermock
How do I mock a method using EasyMock

User getUser(int id) { User user = service.get( id ); if( user != null ) { user.Stuff = getUserStuff( id ); return User; } throw new …

java unit-testing mocking easymock
EasyMock returns Null for Expected Method

I have am having a problem with EasyMock returning null for an expected (defined) method call. Creation of the mocked …

java junit dao easymock
How to ignore unexpected method calls in JUnit/easymock?

I'm just wondering if it is possible using Junit and easymock to ignore unexpected method calls? I.e. instead of …

java junit mocking easymock
Java unit test can't access ResourceBundle

I am creating a Java unit test to test some code I recently changed. However, the method I am testing …

java unit-testing junit easymock resourcebundle
How do you use spring's injection for unit testing a controller?

I want to test my spring mvc controller. The controller has a service: @Autowired UserService userService And my user service …

java spring junit easymock
Mockito preferrable over EasyMock?

Recently I made the switch to Mockito framework and am very happy with it (see also blog-post). The switch from …

java unit-testing mocking easymock mockito
During suite tests EasyMock says 0 matchers expected 1 recorded

So I've been using EasyMock's class extension for a while now. All of a sudden I'm getting this exception, but …

easymock matcher
How to expect void method call with any argument using EasyMock

As a part of unit test I need to mock a void function(Which accept any non-primitive paramter. e.g. …

unit-testing junit easymock
Mock Runtime.getRuntime()?

Can anyone make any suggestions about how best to use EasyMock to expect a call to Runtime.getRuntime().exec(xxx)? …

java unit-testing junit easymock runtime.exec