Actually the problem is in the spec wording - it does not declare which bean archive a custom bean added via AfterBeanDiscovery#addBean() belongs to. And this info is required to determine selected alternatives.
11.5.2. AfterBeanDiscovery event
addBean() fires an event of type ProcessBean containing the given Bean and then registers the Bean with the container, thereby making it available for injection into other beans.
Also note that extension itself does not have to be inside a bean archive.
12.1. Bean archives
An extension may be deployed in any archive, including those that are not bean archives.
Alternative stuff was temporary removed from the test.
Actually the problem is in the spec wording - it does not declare which bean archive a custom bean added via AfterBeanDiscovery#addBean() belongs to. And this info is required to determine selected alternatives.
Also note that extension itself does not have to be inside a bean archive.
Alternative stuff was temporary removed from the test.