JIRA: https://jira.spring.io/browse/INT-4145 Strange stubbing failure on spied template. Perhaps some JIT interaction since the method is used normally before stubbing. Change the spy to a mock for the last part of the test. Remove comment before the mock since it isn't relevant any more