1 package mockit;
2
3 import static org.junit.jupiter.api.Assertions.fail;
4
5 import javax.inject.Inject;
6
7 import org.junit.Test;
8
9
10
11
12 public final class StandardDI2Test {
13
14
15
16
17 static class TestedClass {
18
19
20
21
22 TestedClass() {
23 throw new RuntimeException("Must not occur");
24 }
25
26
27
28
29
30
31
32 @Inject
33 TestedClass(Runnable action) {
34 }
35 }
36
37
38 @Tested
39 TestedClass tested;
40
41
42
43
44 @Test(expected = IllegalArgumentException.class)
45 public void attemptToCreateTestedObjectThroughAnnotatedConstructorWithMissingInjectables() {
46 fail();
47 }
48 }