After upgrade to Spring Boot v2.2 the test configuration class which is annotated with @TestConfiguration is not proxied by CGLIB anymore, thus calling @Bean methods return new instances every time.
After quick search in Spring Framework cores changes gives a hint:
[...] or not finding annotations anymore where they have previously been found accidentally.
The corresponding commit in Spring Framework.