LPS-44288 Refactor test to use org.mockito.Mockito.spy instead of BeanLocator anonymous inner class