Skip to content

Improvement: Don't check whenever(mock)-calls on verifyNoMoreInteractions(mock) #296

Open
@larmic

Description

@larmic
@Test
internal fun `some testing`() {
     val pong = Pong()
     whenever(mock.ping()).thenReturn(pong)
     assertThat(pingService.sendPing()).isEqualTo(pong)

     // this verification is already defined by whenever(...) 
     verify(mock).ping()
     // but is is needed, because otherwise this will fail
     verifyNoMoreInteractions(mock)
}

It will be reduce code if verifyNoMoreInteractions will not check whenever-calls or this could be configurable by an optional parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions