-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into handle-request-batchid
- Loading branch information
Showing
3 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...middleware/triptracker/interactions/busnotifiers/UsRideGwinnettNotifyBusOperatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.opentripplanner.middleware.triptracker.interactions.busnotifiers; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.junit.jupiter.api.Test; | ||
import org.opentripplanner.middleware.models.TrackedJourney; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
class UsRideGwinnettNotifyBusOperatorTest { | ||
@Test | ||
void hasNotCanceledNotificationForRoute() throws JsonProcessingException { | ||
TrackedJourney journey = new TrackedJourney(); | ||
// A request was sent to the bus driver on bus route 10. | ||
journey.busNotificationMessages.put("Route10", "{\"msg_type\": 1}"); | ||
// A request was sent then canceled to the bus driver on bus route 20. | ||
journey.busNotificationMessages.put("Route20", "{\"msg_type\": 0}"); | ||
|
||
assertTrue(UsRideGwinnettNotifyBusOperator.hasNotSentNotificationForRoute(journey, "Route30")); | ||
assertThrows(IllegalStateException.class, () -> UsRideGwinnettNotifyBusOperator.hasNotCanceledNotificationForRoute(journey, "Route30")); | ||
|
||
assertTrue(UsRideGwinnettNotifyBusOperator.hasNotCanceledNotificationForRoute(journey, "Route10")); | ||
|
||
assertFalse(UsRideGwinnettNotifyBusOperator.hasNotCanceledNotificationForRoute(journey, "Route20")); | ||
} | ||
} |