I started working on ACT-1555 (https://jira.codehaus.org/browse/ACT-1555) and wrote a JUnit-test. The code can be found here: https://github.com/rbraeunlich/activiti-unit-test-bean-lookup Unfortunately, the test only has a 50/50 chance to show the error (at least it seems 50/50 to me ). Weld's BeanManager implementation uses a set to keep its resolved beans. The test fails (and shows the bug) only when the first bean in the set is not the @Alternative annotated bean. I am not really satisfied with a test, which doesn't show the possible bug with certainty. Do you guys hava an idea, how to write the test in a better way? I also looked for a way to manipulate the BeanManager but didn't find one.
I am sorry, but which part of my question has been discussed recently? BeanManager or JUnit tests that fail sometimes? I can't find anything that matches my topic (only my thread, which led to the issue).