4

I have a question related to jmock library. I am trying to mock a method that has a parameter of long[] and with(any()). Is there a direct way to do that?

public class A
{
 public void Method_A(long[]  a)
 {
  //Do Somthing. need to mocking 
 }
}
Sami
  • 1,369
  • 14
  • 35
  • 1
    What is the error you've encountered? Sample code will help. – Robert Munteanu Jul 11 '11 at 12:17
  • The problem is that I couldn't find a way to do it. I cannot treat it as an object since it doesn't have a '.class' data member. And I cannot treat it as a primitive type as well since the with(equalTo()) isn't available for arrays. – Sami Jul 11 '11 at 12:21

1 Answers1

9

Yes. Just use any(long[].class).

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • Sorry, for some reason Netbeans shows that .class is not available for long[]. You are right, thanks. – Sami Jul 11 '11 at 12:36