@@ -0,0 +1,1182 @@
+package de.rennspur.test.beans;%0D%0A%0D%0Aimport javax.persistence.EntityManager;%0D%0Aimport javax.persistence.EntityManagerFactory;%0D%0Aimport javax.persistence.Query;%0D%0A%0D%0Aimport static org.junit.Assert.*;%0D%0Aimport static org.mockito.Mockito.*;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0Aimport org.junit.runner.RunWith;%0D%0Aimport org.mockito.InjectMocks;%0D%0Aimport org.mockito.Mock;%0D%0Aimport org.mockito.junit.MockitoJUnitRunner;%0D%0A%0D%0Aimport de.rennspur.beans.EventBean;%0D%0Aimport de.rennspur.model.Event;%0D%0A/**%0D%0A * Tests for UnitEventBean.%0D%0A * %0D%0A * @author maXLeev%0D%0A */%0D%0A@RunWith(MockitoJUnitRunner.class)%0D%0Apublic class EventBeanTest %7B%0D%0A%09%0D%0A%09@InjectMocks%0D%0A%09EventBean proband;%0D%0A%09%0D%0A%09@Mock%0D%0A%09EntityManagerFactory emf;%0D%0A%09@Mock%0D%0A%09EntityManager em;%0D%0A%09@Mock%0D%0A%09Query q;%0D%0A%0D%0A%09List%3CEvent%3E list;%0D%0A%09%0D%0A%09@Before%0D%0A%09public void setUp() throws Exception%7B%0D%0A%09%09when(emf.createEntityManager()).thenReturn(em);%0D%0A%09%09when(em.createNamedQuery(%22Event.findAll%22)).thenReturn(q);%0D%0A%09%09when(q.getResultList()).thenReturn(list = new ArrayList%3CEvent%3E());%0D%0A%09%09%0D%0A%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void testInit()%7B%0D%0A%09%09proband.init();%0D%0A%09%09assertEquals(proband.getEvents(), list);%09%09%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

Test for EventBean.