-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
Description
bindMany and All annotation doesn't permit to setup up the binded instance with a before annotated method.
The following code demonstrate the use case:
import org.jukito.All;
import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
interface TestInterface {
void foo();
}
class ImplOne implements TestInterface {
public void foo() {
}
}
class ImplTwo implements TestInterface {
public void foo() {
}
}
@RunWith(JukitoRunner.class)
public class BindManyTest {
public static class Module extends JukitoModule {
@Override
protected void configureTest() {
bindMany(TestInterface.class, ImplOne.class, ImplTwo.class);
}
}
@Before
public void setup(TestInterface test) {
System.out.println(test.getClass().getSimpleName());
}
@Test
public void testGetFlight(@All TestInterface test) {
System.out.println(test.getClass().getSimpleName());
}
}When running the test I expect as output:
ImplOne
ImplOne
ImplTwo
ImplTwo
Instead the output is:
TestInterface$$EnhancerByMockitoWithCGLIB$$78a15e3b
ImplOne
TestInterface$$EnhancerByMockitoWithCGLIB$$78a15e3b
ImplTwo
It's possible to support the All annotation also in Before method or fix the behavior?