private static final User ANOTHER_USER = new User();\r
private static final Trip TO_BRAZIL = new Trip();\r
private static final Trip TO_BERLIN = new Trip();\r
- private User loggedInUser;\r
private TripService tripService;\r
\r
@Before\r
public void setUp() {\r
tripService = new TesteableTripService();\r
- loggedInUser = REGISTERED_USER;\r
}\r
\r
@Test(expected=UserNotLoggedInException.class) public void\r
- throw_an_exception_when_user_is_not_logged_in() {\r
- loggedInUser = GUEST;\r
- \r
+ throw_an_exception_when_user_is_not_logged_in() { \r
tripService.getTripsByUser(UNUSED_USER, GUEST);\r
}\r
\r
.withTrips(TO_BRAZIL)\r
.build();\r
\r
- List<Trip> friendTrips = tripService.getTripsByUser(friend, loggedInUser); \r
+ List<Trip> friendTrips = tripService.getTripsByUser(friend, REGISTERED_USER); \r
// You must always begin writing the assert.\r
// Remember: the assert must match the unit test method's name!!\r
// In this case, no trips must be returned.\r
@Test public void\r
return_friend_trips_when_users_are_friends() {\r
User friend = UserBuilder.aUser()\r
- .friendsWith(ANOTHER_USER, loggedInUser)\r
+ .friendsWith(ANOTHER_USER, REGISTERED_USER)\r
.withTrips(TO_BRAZIL, TO_BERLIN)\r
.build();\r
\r
- List<Trip> friendTrips = tripService.getTripsByUser(friend, loggedInUser); \r
+ List<Trip> friendTrips = tripService.getTripsByUser(friend, REGISTERED_USER); \r
// You must always begin writing the assert.\r
// Remember: the assert must match the unit test method's name!!\r
// In this case, no trips must be returned.\r