On Aug 31, 5:27 am, Johan Haleby <
johan.hal...@gmail.com> wrote:
> Hi,
>
> I cannot seem to reproduce it. I'm doing this:
>
> public class ClassWithAMethod {
>
> public void connect(Connection connection) {
> if(connection == null) {
> throw new IllegalArgumentException("param was null");
> }
> }}
>
> The test;
>
> ClassWithAMethod classWithAMethod = new ClassWithAMethod();
> Connection connection = null;
> Whitebox.invokeMethod(classWithAMethod, "connect", connection);
>
> This works for me. Do you only see this problem when you're using Whitebox
> to invoke a method on a mocked object? In the example you posted to me why
> do want to invoke the method using reflection/Whitebox? Or was that just to
> demonstrate the issue? If you would do partial mocking then it could make
> sense but now I don't see the point?!
>
> /Johan
>