File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 22
33import static org .jboss .shrinkwrap .api .ShrinkWrap .create ;
44import static org .junit .Assert .assertEquals ;
5+ import static org .junit .Assert .assertThat ;
56
67import javax .inject .Inject ;
78
9+ import org .hamcrest .Matchers ;
810import org .jboss .arquillian .container .test .api .Deployment ;
911import org .jboss .arquillian .junit .Arquillian ;
1012import org .jboss .shrinkwrap .api .spec .JavaArchive ;
1315import org .junit .runner .RunWith ;
1416
1517/**
16- *
18+ *
1719 * @author Arjan Tijms
1820 *
1921 */
2022@ RunWith (Arquillian .class )
2123public class DynamicBeanTest {
22-
24+
2325 @ Deployment
2426 public static WebArchive deploy () {
2527 return create (WebArchive .class )
@@ -35,6 +37,7 @@ public static WebArchive deploy() {
3537
3638 @ Test
3739 public void test () {
40+ assertThat ("myBean" , myBean , Matchers .notNullValue ());
3841 assertEquals ("Hi!" , myBean .sayHi ());
3942 }
4043}
Original file line number Diff line number Diff line change 22
33import static org .jboss .shrinkwrap .api .ShrinkWrap .create ;
44import static org .junit .Assert .assertEquals ;
5+ import static org .junit .Assert .assertThat ;
56
67import javax .inject .Inject ;
78
9+ import org .hamcrest .Matchers ;
810import org .javaee8 .jpa .dynamic .tx .ApplicationInit ;
911import org .javaee8 .jpa .dynamic .tx .Employee ;
1012import org .javaee8 .jpa .dynamic .tx .EmployeeService ;
@@ -41,11 +43,12 @@ public static WebArchive createDeployment() {
4143 public void testPersist () throws Exception {
4244 Employee employee = new Employee ();
4345 employee .setName ("reza" );
44-
46+
47+ assertThat ("employeeService" , employeeService , Matchers .notNullValue ());
4548 employeeService .persist (employee );
46-
49+
4750 Employee persistedEmployee = employeeService .getById (employee .getId ());
48-
51+
4952 assertEquals ("reza" , persistedEmployee .getName ());
5053 }
5154
You can’t perform that action at this time.
0 commit comments