Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7569955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:17:47+00:00 2026-05-30T15:17:47+00:00

Is there any good feature in EasyMock that is not there or not properly

  • 0

Is there any good feature in EasyMock that is not there or not properly handled (as compared to EasyMock) in Mockito?

I would like to know about some feature like for eg. Mockito supports easy injection of all mocks into the Class Under Test by using the @ InjectMocks, which is not the case in EasyMock (out of the box). Similarly are there any features in EasyMock which are either not there or not handled as good as in EasyMock?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:17:48+00:00Added an answer on May 30, 2026 at 3:17 pm

    One feature that comes to mind is the support for implicitly verified expectations, which Mockito lacks:

    @Test
    public void usingEasyMock()
    {
        Collaborator mock = createMock(Collaborator.class);
    
        expect(mock.registerXyz("xyz")).andReturn(true);
        replay(mock);
    
        new ClassUnderTest().doSomething(mock);
    
        verify(mock);
    }
    
    
    @Test
    public void usingMockito()
    {
        Collaborator mock = mock(Collaborator.class);
    
        when(mock.registerXyz("xyz")).thenReturn(true);
    
        new ClassUnderTest().doSomething(mock);
    
        verify(mock).registerXyz("xyz");
    }
    

    Note the duplicate invocation to registerXyz("xyz") in the second test. Mockito could perhaps add a times(n) method to be used together with calls to thenReturn(...) (which EasyMock has). This would avoid having to duplicate code in situations like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any good reasons for why you would include JavaScript like this: <script
are there any good tutorials online for learning about the c# 2.0 language feature
Any good sources(links) about optimizing Telerik Web controls? I imagine that there are features
Are there any good examples of mvc routing wherein every 404 page not found
Is there any good documentation on implementing new refactorings in Eclipse? Specifically, I'd like
Are there any good resources for learning C++ that a C# user could use,
i wanted to know that is there any algorithm that can be used for
Are there any plugins/addons/website services which support good multi-programmer programming? Just like Google Documents
the file validation of CI is good. but it is not offering any feature
Are there any good technical solutions for extremely long term archiving of data, for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.