Trying to mock a @SessionScope in a test by autowiring it using @SpyBean and then mocking using doReturn(..).when(sessionScopedBean).method(any()) calls the real method with null argument instead of silently registering mock.
Removing @SessionScope from the bean resolves this issue.
Spring boot 2.1.6.RELEASE