You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Delegates the call to <code>Mockito.doReturn(toBeReturned, toBeReturnedNext)</code>
62
-
* but fixes the following compiler issue that happens because the overloaded vararg on the Java side
61
+
* Delegates the call to <code>Mockito.doReturn(toBeReturned, toBeReturnedNext)</code> but fixes the following compiler issue that happens because the overloaded vararg on the
62
+
* Java side
63
63
*
64
-
* {{{Error:(33, 25) ambiguous reference to overloaded definition,
65
-
* both method doReturn in class Mockito of type (x$1: Any, x$2: Object*)org.mockito.stubbing.Stubber
66
-
* and method doReturn in class Mockito of type (x$1: Any)org.mockito.stubbing.Stubber
67
-
* match argument types (`Type`)}}}
64
+
* {{{Error:(33, 25) ambiguous reference to overloaded definition, both method doReturn in class Mockito of type (x$1: Any, x$2: Object*)org.mockito.stubbing.Stubber and method
65
+
* doReturn in class Mockito of type (x$1: Any)org.mockito.stubbing.Stubber match argument types (`Type`)}}}
* Delegates to <code>Mockito.doThrow(type: Class[T])</code>
86
-
* It provides a nicer API as you can, for instance, do doThrow[Throwable] instead of doThrow(classOf[Throwable])
82
+
* Delegates to <code>Mockito.doThrow(type: Class[T])</code> It provides a nicer API as you can, for instance, do doThrow[Throwable] instead of doThrow(classOf[Throwable])
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code>
470
-
* then you could have not verified it like
471
-
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code>
472
-
* as the value for the second parameter would have been null...
463
+
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code> then you could have not verified it like
464
+
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code> as the value for the second parameter would have been null...
* Delegates to <code>Mockito.mock(type: Class[T], defaultAnswer: Answer[_])</code>
479
-
* It provides a nicer API as you can, for instance, do <code>mock[MyClass](defaultAnswer)</code>
470
+
* Delegates to <code>Mockito.mock(type: Class[T], defaultAnswer: Answer[_])</code> It provides a nicer API as you can, for instance, do <code>mock[MyClass](defaultAnswer)</code>
480
471
* instead of <code>mock(classOf[MyClass], defaultAnswer)</code>
481
472
*
482
-
* It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
483
-
* are called, ie:
484
-
* given <code>def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")</code>
473
+
* It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments are called, ie: given <code>def
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code>
487
-
* then you could have not verified it like
488
-
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code>
489
-
* as the value for the second parameter would have been null...
476
+
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code> then you could have not verified it like
477
+
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code> as the value for the second parameter would have been null...
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code>
504
-
* then you could have not verified it like
505
-
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code>
506
-
* as the value for the second parameter would have been null...
489
+
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code> then you could have not verified it like
490
+
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code> as the value for the second parameter would have been null...
* Delegates to <code>Mockito.mock(type: Class[T], name: String)</code>
549
-
* It provides a nicer API as you can, for instance, do <code>mock[MyClass](name)</code>
550
-
* instead of <code>mock(classOf[MyClass], name)</code>
532
+
* Delegates to <code>Mockito.mock(type: Class[T], name: String)</code> It provides a nicer API as you can, for instance, do <code>mock[MyClass](name)</code> instead of
533
+
* <code>mock(classOf[MyClass], name)</code>
551
534
*
552
-
* It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
553
-
* are called, ie:
554
-
* given <code>def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")</code>
535
+
* It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments are called, ie: given <code>def
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code>
557
-
* then you could have not verified it like
558
-
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code>
559
-
* as the value for the second parameter would have been null...
538
+
* without this fix, if you call it as <code>iHaveSomeDefaultArguments("I'm not gonna pass the second argument")</code> then you could have not verified it like
539
+
* <code>verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")</code> as the value for the second parameter would have been null...
* Creates a "spy" in a way that supports lambdas and anonymous classes as they don't work with the standard spy as
622
-
* they are created as final classes by the compiler
599
+
* Creates a "spy" in a way that supports lambdas and anonymous classes as they don't work with the standard spy as they are created as final classes by the compiler
* Spies the specified object only for the context of the block
634
611
*
635
-
* Automatically pulls in [[org.mockito.LeniencySettings#strictStubs strict stubbing]] behaviour via implicits.
636
-
* To override this default (strict) behaviour, bring lenient settings into implicit scope;
637
-
* see [[org.mockito.leniency]] for details
612
+
* Automatically pulls in [[org.mockito.LeniencySettings#strictStubs strict stubbing]] behaviour via implicits. To override this default (strict) behaviour, bring lenient
613
+
* settings into implicit scope; see [[org.mockito.leniency]] for details
* The idea is based on org.scalatest.mockito.MockitoSugar but it adds 100% of the Mockito API
728
704
*
729
-
* It also solve problems like overloaded varargs calls to Java code and pre-stub the mocks so the default arguments
730
-
* in the method parameters work as expected
705
+
* It also solve problems like overloaded varargs calls to Java code and pre-stub the mocks so the default arguments in the method parameters work as expected
0 commit comments