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

  • Home
  • SEARCH
  • 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 8111043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:57:53+00:00 2026-06-06T01:57:53+00:00

I have built a mock object using EasyMock, and I’m trying to have the

  • 0

I have built a mock object using EasyMock, and I’m trying to have the object return another object after a method call. The method call does not cause any exception to be thrown, but it returns null, though I am certain the andReturn() call had a non-null argument.

  • 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-06-06T01:57:54+00:00Added an answer on June 6, 2026 at 1:57 am

    The problem here was that I had not called replay() on the mock object after specifying the behavior. For some reason, this caused it to allow some of the expected behaviors, but always return null for when a return value was expected. Remember to call replay() before using the mock.

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

Sidebar

Related Questions

I have built a mobile app using Rhomobile, jQuery Mobile and Google Maps API.
I have built and app which does random stuff and I want to collect
i have built application using codeigniter, my controller name is userReg , in controller
I'm trying to add unit testing to an ASP.NET MVC application I have built.
I have built a simple StreamGeometry, using MSDN example: StreamGeometry geometry = new StreamGeometry();
I am trying a very simple example using EasyMock , however I simply cannot
I have a python method does the following: list the files under a directory
I have built a webpage, splashcreen.html , that when someone loads index.php will automatically
I have built a voucher website, where each voucher has a countdown timer. When
I have built a table which on of it's row is like so <tr

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.