-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5916 from ibi-group/gtfsrt-module-tests
Convert remaining GTFS-RT tests to module tests
- Loading branch information
Showing
13 changed files
with
510 additions
and
764 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
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
23 changes: 23 additions & 0 deletions
23
src/test/java/org/opentripplanner/updater/spi/UpdateResultAssertions.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,23 @@ | ||
package org.opentripplanner.updater.spi; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.Set; | ||
|
||
public class UpdateResultAssertions { | ||
|
||
public static void assertFailure(UpdateError.UpdateErrorType expectedError, UpdateResult result) { | ||
assertEquals(Set.of(expectedError), result.failures().keySet()); | ||
} | ||
|
||
public static void assertSuccess(UpdateResult updateResult) { | ||
var errorCodes = updateResult.failures().keySet(); | ||
assertEquals( | ||
Set.of(), | ||
errorCodes, | ||
"Update result should have no error codes but had %s".formatted(errorCodes) | ||
); | ||
assertTrue(updateResult.successful() > 0); | ||
} | ||
} |
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
Oops, something went wrong.