File tree 2 files changed +11
-5
lines changed
cdi/dynamic-bean/src/test/java/org/javaee8/cdi/dynamic/bean
jpa/dynamic-tx/src/test/java/org/javaee8/jpa/dynamic/tx 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import static org .jboss .shrinkwrap .api .ShrinkWrap .create ;
4
4
import static org .junit .Assert .assertEquals ;
5
+ import static org .junit .Assert .assertThat ;
5
6
6
7
import javax .inject .Inject ;
7
8
9
+ import org .hamcrest .Matchers ;
8
10
import org .jboss .arquillian .container .test .api .Deployment ;
9
11
import org .jboss .arquillian .junit .Arquillian ;
10
12
import org .jboss .shrinkwrap .api .spec .JavaArchive ;
13
15
import org .junit .runner .RunWith ;
14
16
15
17
/**
16
- *
18
+ *
17
19
* @author Arjan Tijms
18
20
*
19
21
*/
20
22
@ RunWith (Arquillian .class )
21
23
public class DynamicBeanTest {
22
-
24
+
23
25
@ Deployment
24
26
public static WebArchive deploy () {
25
27
return create (WebArchive .class )
@@ -35,6 +37,7 @@ public static WebArchive deploy() {
35
37
36
38
@ Test
37
39
public void test () {
40
+ assertThat ("myBean" , myBean , Matchers .notNullValue ());
38
41
assertEquals ("Hi!" , myBean .sayHi ());
39
42
}
40
43
}
Original file line number Diff line number Diff line change 2
2
3
3
import static org .jboss .shrinkwrap .api .ShrinkWrap .create ;
4
4
import static org .junit .Assert .assertEquals ;
5
+ import static org .junit .Assert .assertThat ;
5
6
6
7
import javax .inject .Inject ;
7
8
9
+ import org .hamcrest .Matchers ;
8
10
import org .javaee8 .jpa .dynamic .tx .ApplicationInit ;
9
11
import org .javaee8 .jpa .dynamic .tx .Employee ;
10
12
import org .javaee8 .jpa .dynamic .tx .EmployeeService ;
@@ -41,11 +43,12 @@ public static WebArchive createDeployment() {
41
43
public void testPersist () throws Exception {
42
44
Employee employee = new Employee ();
43
45
employee .setName ("reza" );
44
-
46
+
47
+ assertThat ("employeeService" , employeeService , Matchers .notNullValue ());
45
48
employeeService .persist (employee );
46
-
49
+
47
50
Employee persistedEmployee = employeeService .getById (employee .getId ());
48
-
51
+
49
52
assertEquals ("reza" , persistedEmployee .getName ());
50
53
}
51
54
You can’t perform that action at this time.
0 commit comments