-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix typo in TimeframeOverlapNotice class name (#1569)
* Fix typo in TimeframeOverlapNotice name + add test to prevent future typos.
- Loading branch information
1 parent
95f0c9a
commit 96a1b4d
Showing
3 changed files
with
34 additions
and
5 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
29 changes: 29 additions & 0 deletions
29
main/src/test/java/org/mobilitydata/gtfsvalidator/validator/NoticeNameTest.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,29 @@ | ||
package org.mobilitydata.gtfsvalidator.validator; | ||
|
||
import static com.google.common.truth.Truth.assertWithMessage; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
import org.mobilitydata.gtfsvalidator.notice.Notice; | ||
import org.mobilitydata.gtfsvalidator.notice.ValidationNotice; | ||
|
||
@RunWith(JUnit4.class) | ||
public class NoticeNameTest { | ||
|
||
@Test | ||
public void testAllValidationNoticeClassesEndWithNotice() { | ||
List<Class<Notice>> noticesWithoutNoticeSuffix = | ||
ClassGraphDiscovery.discoverNoticeSubclasses(ClassGraphDiscovery.DEFAULT_NOTICE_PACKAGES) | ||
.stream() | ||
.filter(c -> ValidationNotice.class.isAssignableFrom(c)) | ||
.filter(c -> !c.getSimpleName().endsWith("Notice")) | ||
.collect(Collectors.toList()); | ||
assertWithMessage( | ||
"All GtfsValidationNotice subclasses must have \"Notice\" as their class name suffix, but the following classes do not:") | ||
.that(noticesWithoutNoticeSuffix) | ||
.isEmpty(); | ||
} | ||
} |
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