(classes & class-list)
Converts the list of given classes into a Java array, especially when Mockito's thenThrow method accepts varargs.
Converts the list of given classes into a Java array, especially when Mockito's thenThrow method accepts varargs.
(mock klass)
Returns the Mockito-mocked object.
Returns the Mockito-mocked object.
(spy obj)
Returns the Mockito-spied (real) object.
Returns the Mockito-spied (real) object.
(throwables & throwable-list)
Converts the list of given throwables into a Java array, useful for Mockito methods that expects throwables as varargs.
Converts the list of given throwables into a Java array, useful for Mockito methods that expects throwables as varargs.
(when-> mocked action & behaviors)
Stubs the given mocked object. Returns the mocked object, making it very easy to create mocks in tests. For example:
(when-> (mock List) (.get 0) (.thenThrow (classes RuntimeException))) (when-> (mock List) (.get 1) (.thenReturn "first") (.thenReturn "second"))
Stubs the given mocked object. Returns the mocked object, making it very easy to create mocks in tests. For example: (when-> (mock List) (.get 0) (.thenThrow (classes RuntimeException))) (when-> (mock List) (.get 1) (.thenReturn "first") (.thenReturn "second"))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close