To reproduce it, run ApplicationTests.test() with the following sample: https://github.com/izeye/spring-boot-throwaway-branches/tree/minimal

It fails with Spring Boot 2.6.0-M2, but passes with 2.6.0-M1.

This was just an experimental code, not for any real usage. I'm just sharing this behavioral change as it might be a side effect of some unintended changes.

Feel free to close this if it's not an issue.

Comment From: wilkinsona

This was intended. It's due to circular references now being prohibited by default. In this case, creating SampleConfig requires the Person bean to be created and, as the person() method is not static, creating the Person bean requires SampleConfig to be created.