-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find Bean Classes In '@Inject'-ed Instance<BeanType> Field
Fixes #115
- Loading branch information
1 parent
96f3dbe
commit d29ae4b
Showing
5 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
junit5/src/test/java/org/jboss/weld/junit5/auto/InjectInstanceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jboss.weld.junit5.auto; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import javax.enterprise.context.Dependent; | ||
import javax.enterprise.inject.Instance; | ||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
@EnableAutoWeld | ||
public class InjectInstanceTest { | ||
|
||
@Dependent | ||
static class Foo { | ||
} | ||
|
||
@Inject | ||
Instance<Foo> fooInstance; | ||
|
||
@Test | ||
void test() { | ||
assertNotNull(fooInstance.get()); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedInstanceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jboss.weld.junit5.auto; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import javax.enterprise.context.Dependent; | ||
import javax.enterprise.inject.Instance; | ||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
@EnableAutoWeld | ||
public class InjectParameterizedInstanceTest { | ||
|
||
@Dependent | ||
static class Foo<T> { | ||
} | ||
|
||
@Inject | ||
Instance<Foo<String>> fooInstance; | ||
|
||
@Test | ||
void test() { | ||
assertNotNull(fooInstance.get()); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
junit5/src/test/java/org/jboss/weld/junit5/auto/InjectParameterizedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jboss.weld.junit5.auto; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import javax.enterprise.context.Dependent; | ||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
@EnableAutoWeld | ||
public class InjectParameterizedTest { | ||
|
||
@Dependent | ||
static class Foo<T> { | ||
} | ||
|
||
@Inject | ||
Foo<String> foo; | ||
|
||
@Test | ||
void test() { | ||
assertNotNull(foo); | ||
} | ||
|
||
} |