mockito-kotlin icon indicating copy to clipboard operation
mockito-kotlin copied to clipboard

Using Mockito with Kotlin

Results 98 mockito-kotlin issues
Sort by recently updated
recently updated
newest added
trafficstars

This may be a feature request and is related to #368 When spying + stubbing a field, the stub is actually on the getter but not on the field used...

I have ``` open class Mockable { open fun testWithEmptyCallback(someString: String, anotherString: String, callback:() -> Unit) open fun testWithBooleanCallback(someString: String, anotherString: String, callback:(Boolean) -> Unit) } ``` Then I do...

It's unexpected because: ``` val someObject = Mockito.spy(SomeClass(dependency1, dependency2)) // ... Mockito.doReturn(someResult).`when`(someObject).someMethod(param1) ``` Does not call the real `someMethod` Or is this library's `spy` is intended to work differently from...

It looks like Mockito is using `null` as a default value for properties in a interface even though they are non-nullable. Reproduce: ```kotlin interface Dog { val name: String }...

These are not wrapped, I can use them as intended but I have to use `any()`. There must be a reason for this I am unaware of (not putting them...

Hi, I'dont now if this is a bug. I'm trying to verify two arguments by using `check {}`. Of course I can use an argument capture, but I'm expecting this...

I get an `IncompatibleClassChangeError` with any use of the `argThat` matcher. Full stacktrace: https://pastebin.com/4hr67L0r. I am using version `2.0.0`. Here is a simple example I replicated the problem with: ```kotlin...

type:question

Mockito provides 2 constructions for stubbing: `doReturn(...).when(...)` `when(...).thenReturn(...)` The first one is known not to call real method, which is sometimes handy ([source](https://stackoverflow.com/a/29394497/6507689)) There are nice extensions for the second...

Is it possible to do this? ```kotlin interface Repository { fun setFoo(value) fun getFoo() } ... class Intercator (repository: Repository) { fun setFoo(value) { repository.setFoo(value) } fun getFoo() { return...

### Info: - Reference: https://kotlinlang.org/docs/reference/basic-types.html#unsigned-integers - KEEP: https://github.com/Kotlin/KEEP/blob/master/proposals/unsigned-types.md ### Test case: ``` @Test fun mockitoTest() { val fixture: UnsignedFixture = mock() fixture.ubyte(42u) fixture.ushort(42u) fixture.uInt(42u) fixture.uLong(42u) verify(fixture).ubyte(eq(42u)) verify(fixture).ushort(eq(42u)) verify(fixture).uInt(eq(42u)) verify(fixture).uLong(eq(42u)) }...