-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
When testing with @Nested classes, Weld initiates a container for each nested level. Could be related to #288, though this is regardless of @TestInstance(Lifecycle.PER_CLASS).
For example:
@EnableAutoWeld
public class WeldTest {
@Nested
class A {
@Test
void a() {
System.out.println("a");
}
@Nested
class A2 {
@Test
void a() {
System.out.println("a");
}
}
}
@Nested
class B {
@Test
void a() {
System.out.println("a");
}
}
}will start 3 containers: for WedTest, A and A2. Removing B does nothing. This causes a warning in more complicated cases:
org.jboss.weld.environment.se.WeldSEProvider getCDI
INFO: WELD-ENV-002006: Multiple containers running - CDI.current() may not work properly
Is this the correct behavior? I'd assume the same container can be used here.
Metadata
Metadata
Assignees
Labels
No labels