Removing duplicated code
authorGustavo Martin Morcuende <gustavo.martin@scmspain.com>
Wed, 23 Nov 2016 21:00:00 +0000 (22:00 +0100)
committerGustavo Martin Morcuende <gustavo.martin@scmspain.com>
Wed, 23 Nov 2016 21:00:00 +0000 (22:00 +0100)
TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java

index b8177d0..3b87700 100644 (file)
@@ -24,6 +24,7 @@ public class TripServiceShould {
        @Before\r
        public void setUp() {\r
                tripService = new TesteableTripService();\r
+               loggedInUser = REGISTERED_USER;\r
        }\r
 \r
        @Test(expected=UserNotLoggedInException.class) public void\r
@@ -34,9 +35,7 @@ public class TripServiceShould {
        }\r
        \r
        @Test public void\r
-       not_return_any_trips_when_users_are_not_friends() {             \r
-               loggedInUser = REGISTERED_USER;\r
-               \r
+       not_return_any_trips_when_users_are_not_friends() {     \r
                User friend = new User();\r
                friend.addFriend(ANOTHER_USER);\r
                friend.addTrip(TO_BRAZIL);\r
@@ -49,9 +48,7 @@ public class TripServiceShould {
        }\r
        \r
        @Test public void\r
-       return_friend_trips_when_users_are_friends() {\r
-               loggedInUser = REGISTERED_USER;\r
-               \r
+       return_friend_trips_when_users_are_friends() {          \r
                User friend = new User();\r
                friend.addFriend(loggedInUser);\r
                friend.addFriend(ANOTHER_USER);\r