2 Replies Latest reply on Sep 16, 2014 9:38 AM by mlybarger

    Unit testing CDI beans

    mlybarger

      I have a sy application which uses several CDI beans.  I want to write some unit tests for the cdi beans and thought i could use the sy runner with the CDIMixin. Then in my test class I would use something like:

       

      @SwitchYardTestCaseConfig(mixins={CDIMixIn.class})

      @RunWith(SwitchyardRunner.class)

      public class MyTest {

       

           @Inject

           MyCDIBean myCDIBean;

       

           @Test

           public void testMyCDIBean() {

                assertNotNull(myCDIBean);

           }

       

      }

       

      But this fails.  is there an example of using the SwitchyardRunner for testing a cdi bean?  my container is FSW 6.0.0 GA.

       

      thanks!

      -mark-