package de.hilling.cdi.sampleapp.controller;

import de.hilling.cdi.sampleapp.ejb.RegistrationService;
import de.hilling.junit.cdi.CdiUnitRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;

import javax.inject.Inject;

@RunWith(CdiUnitRunner.class)
public class RegistrationBeanTest {

    @Inject
    private RegistrationBean registrationBean;

    @Mock
    private RegistrationService service;

    @Test
    public void register() {
        registrationBean.setAge(10);
        registrationBean.setName("Gunnar");
        registrationBean.register();
        Mockito.verify(service).register("Gunnar");
    }

}
@@ -139,16 +139,66 @@
 Runner;%0A
+import org.junit.Assert;%0Aimport org.junit.Before;%0A
 import o
@@ -512,20 +512,22 @@
 ;%0A%0A    @
-Test
+Before
 %0A    pub
@@ -535,24 +535,21 @@
 ic void 
-register
+setUp
 () %7B%0A   
@@ -622,24 +622,246 @@
 (%22Gunnar%22);%0A
+    %7D%0A%0A    @Test%0A    public void checkValues() %7B%0A        Assert.assertEquals(%22Gunnar%22, registrationBean.getName());%0A        Assert.assertEquals(10, registrationBean.getAge());%0A    %7D%0A%0A    @Test%0A    public void register() %7B%0A
         regi

Add unit tests.