October 24, 2024
Chicago 12, Melborne City, USA
java

Can you mock a method that uses output params?


I have a method that looks like this:

public void action(ActionCode actionCode, Object param)

For param, I pass in an AtomicBoolean. I cannot change the signature of that method. Is there a way to mock it so I set the passed in AtomicBoolean to true? I also can’t create a wrapper method in this case since the code that calls that method is an aspect.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video