File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
validation/methods/src/test/java/org/javaee7/validation/methods Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .javaee7 .validation .methods ;
2+
3+ import javax .enterprise .inject .Instance ;
4+ import javax .inject .Inject ;
5+
6+ import org .jboss .arquillian .container .test .api .Deployment ;
7+ import org .jboss .arquillian .junit .Arquillian ;
8+ import org .jboss .shrinkwrap .api .Archive ;
9+ import org .jboss .shrinkwrap .api .ShrinkWrap ;
10+ import org .jboss .shrinkwrap .api .asset .EmptyAsset ;
11+ import org .jboss .shrinkwrap .api .spec .JavaArchive ;
12+ import org .jboss .weld .exceptions .UnsatisfiedResolutionException ;
13+ import org .junit .Rule ;
14+ import org .junit .Test ;
15+ import org .junit .rules .ExpectedException ;
16+ import org .junit .runner .RunWith ;
17+
18+ /**
19+ * @author Jakub Marchwicki
20+ */
21+ @ RunWith (Arquillian .class )
22+ public class ConstructorParametersInjectionTest {
23+
24+ @ Inject
25+ Instance <MyBean2 > bean ;
26+
27+ @ Rule
28+ public ExpectedException thrown = ExpectedException .none ();
29+
30+ @ Deployment
31+ public static Archive <?> deployment () {
32+ return ShrinkWrap .create (JavaArchive .class ).addClasses (MyBean2 .class )
33+ .addAsManifestResource (EmptyAsset .INSTANCE , "beans.xml" );
34+ }
35+
36+ @ Test
37+ public void constructorViolationsWhenNullParameters () throws NoSuchMethodException , SecurityException {
38+ thrown .expect (UnsatisfiedResolutionException .class );
39+ bean .get ();
40+ }
41+
42+ }
You can’t perform that action at this time.
0 commit comments