Skip to content

Abstract method mocking prints wrong call count in exception [SPR-10885] #15513

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andreas Hubmer opened SPR-10885 and commented

In case a mocked method is called too often an IllegalStateException is thrown. In the exception text the number of expected calls and the number of received calls are printed. The number of received calls is off by one (too low).

Concerned method:
org.springframework.mock.staticmock.AbstractMethodMockingControl.nextCall()

Example:
java.lang.IllegalStateException: Expected 1 calls, received 1
Correct would be:
java.lang.IllegalStateException: Expected 1 calls, received 2


Affects: 3.1.2

Issue Links:

Referenced from: commits 03e243a, 5596154, 3ca0dcd, 69a89b1

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions