File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed
src/test/java/travelator/recommendations Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -73,29 +73,21 @@ public void returns_recommendations_for_single_location() {
73
73
74
74
@ Test
75
75
public void returns_recommendations_for_multi_location () {
76
- when ( featuredDestinations . findCloseTo ( paris ))
77
- . thenReturn ( List .of (
76
+ givenFeaturedDestinationsFor ( paris ,
77
+ List .of (
78
78
eiffelTower ,
79
79
louvre
80
80
));
81
- when (distanceCalculator .distanceInMetersBetween (
82
- paris , eiffelTower .getLocation ())
83
- ).thenReturn (5000 );
84
- when (distanceCalculator .distanceInMetersBetween (
85
- paris , louvre .getLocation ())
86
- ).thenReturn (1000 );
87
-
88
- when (featuredDestinations .findCloseTo (alton ))
89
- .thenReturn (List .of (
81
+ givenADistanceBetween (paris , eiffelTower , 5000 );
82
+ givenADistanceBetween (paris , louvre , 1000 );
83
+
84
+ givenFeaturedDestinationsFor (alton ,
85
+ List .of (
90
86
flowerFarm ,
91
87
watercressLine
92
88
));
93
- when (distanceCalculator .distanceInMetersBetween (
94
- alton , flowerFarm .getLocation ())
95
- ).thenReturn (5300 );
96
- when (distanceCalculator .distanceInMetersBetween (
97
- alton , watercressLine .getLocation ())
98
- ).thenReturn (320 );
89
+ givenADistanceBetween (alton , flowerFarm , 5300 );
90
+ givenADistanceBetween (alton , watercressLine , 320 );
99
91
100
92
assertEquals (
101
93
List .of (
You can’t perform that action at this time.
0 commit comments