Skip to content

Commit

Permalink
#40 #21 Adjusted test to reflect changed session handling
Browse files Browse the repository at this point in the history
  • Loading branch information
britzke committed Apr 20, 2017
1 parent cabecac commit 12ac921
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/test/java/de/rennspur/test/beans/TeamBeanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import de.rennspur.beans.EventBean;
import de.rennspur.beans.TeamBean;
import de.rennspur.model.Event;
import de.rennspur.model.Team;
Expand All @@ -53,10 +52,9 @@ public class TeamBeanTest {
private Query q;
@Mock
private EntityTransaction transaction;

@Mock
private EventBean eventBean;
@Mock
private Event event;
Event selectedEvent;

@InjectMocks
private TeamBean proband;
Expand All @@ -72,7 +70,6 @@ public class TeamBeanTest {
public void setUp() throws Exception {
when(em.createNamedQuery("Team.findTeamsByEventId")).thenReturn(q);
when(q.getResultList()).thenReturn(teams = new ArrayList<Team>());
when(eventBean.getSelectedEvent()).thenReturn(event);
}

/**
Expand All @@ -83,7 +80,7 @@ public void testInit() {
proband.init();

assertEquals(
"The RaceBean's list of races must be the list, which the EntityManager returns for the query 'Race.findRaceByEvent'",
"The TeamBean's list of teams must be the list, which the EntityManager returns for the query 'Race.findRaceByEvent'",
proband.getTeams(), teams);
}

Expand Down

0 comments on commit 12ac921

Please sign in to comment.