View Javadoc
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   * The Class StandardDI2Test.
11   */
12  public final class StandardDI2Test {
13  
14      /**
15       * The Class TestedClass.
16       */
17      static class TestedClass {
18  
19          /**
20           * Instantiates a new tested class.
21           */
22          TestedClass() {
23              throw new RuntimeException("Must not occur");
24          }
25  
26          /**
27           * Instantiates a new tested class.
28           *
29           * @param action
30           *            the action
31           */
32          @Inject
33          TestedClass(Runnable action) {
34          }
35      }
36  
37      /** The tested. */
38      @Tested
39      TestedClass tested;
40  
41      /**
42       * Attempt to create tested object through annotated constructor with missing injectables.
43       */
44      @Test(expected = IllegalArgumentException.class)
45      public void attemptToCreateTestedObjectThroughAnnotatedConstructorWithMissingInjectables() {
46          fail();
47      }
48  }