|
1 | 1 | package org.mobilitydata.gtfsvalidator.validator;
|
2 | 2 |
|
3 |
| -import com.google.common.collect.ImmutableList; |
4 |
| -import com.google.common.collect.ImmutableSet; |
| 3 | +import static com.google.common.truth.Truth.assertThat; |
| 4 | + |
| 5 | +import java.util.List; |
5 | 6 | import org.junit.Test;
|
6 |
| -import org.mobilitydata.gtfsvalidator.input.GtfsInput; |
7 | 7 | import org.mobilitydata.gtfsvalidator.notice.MissingRecommendedFileNotice;
|
8 | 8 | import org.mobilitydata.gtfsvalidator.notice.MissingRequiredFileNotice;
|
9 | 9 | import org.mobilitydata.gtfsvalidator.notice.NoticeContainer;
|
10 | 10 | import org.mobilitydata.gtfsvalidator.notice.ValidationNotice;
|
11 | 11 | import org.mobilitydata.gtfsvalidator.table.*;
|
12 | 12 |
|
13 |
| -import java.io.InputStream; |
14 |
| -import java.util.List; |
15 |
| -import java.util.Locale; |
16 |
| - |
17 |
| - |
18 |
| -import static com.google.common.truth.Truth.assertThat; |
19 |
| - |
20 | 13 | public class MissingFeedInfoValidatorTest {
|
21 | 14 |
|
22 |
| - private static List<ValidationNotice> generateNotices(GtfsFeedInfoTableContainer feedInfoTableContainer, GtfsTranslationTableContainer translationTableContainer) { |
| 15 | + private static List<ValidationNotice> generateNotices( |
| 16 | + GtfsFeedInfoTableContainer feedInfoTableContainer, |
| 17 | + GtfsTranslationTableContainer translationTableContainer) { |
23 | 18 | NoticeContainer noticeContainer = new NoticeContainer();
|
24 |
| - new MissingFeedInfoValidator(feedInfoTableContainer, translationTableContainer).validate(noticeContainer); |
| 19 | + new MissingFeedInfoValidator(feedInfoTableContainer, translationTableContainer) |
| 20 | + .validate(noticeContainer); |
25 | 21 | return noticeContainer.getValidationNotices();
|
26 | 22 | }
|
27 | 23 |
|
28 | 24 | @Test
|
29 | 25 | public void missingFeedInfoTranslationTableNotPresent() {
|
30 | 26 | assertThat(
|
31 | 27 | generateNotices(
|
32 |
| - GtfsFeedInfoTableContainer.forStatus(GtfsTableContainer.TableStatus.MISSING_FILE), |
33 |
| - GtfsTranslationTableContainer.forStatus(GtfsTableContainer.TableStatus.MISSING_FILE))) |
34 |
| - .containsExactly(new MissingRecommendedFileNotice(GtfsFeedInfo.FILENAME)); |
| 28 | + GtfsFeedInfoTableContainer.forStatus(GtfsTableContainer.TableStatus.MISSING_FILE), |
| 29 | + GtfsTranslationTableContainer.forStatus( |
| 30 | + GtfsTableContainer.TableStatus.MISSING_FILE))) |
| 31 | + .containsExactly(new MissingRecommendedFileNotice(GtfsFeedInfo.FILENAME)); |
35 | 32 | }
|
36 | 33 |
|
37 | 34 | @Test
|
38 | 35 | public void missingFeedInfoWhenTranslationTableIsPresent() {
|
39 | 36 | assertThat(
|
40 | 37 | generateNotices(
|
41 |
| - GtfsFeedInfoTableContainer.forStatus(GtfsTableContainer.TableStatus.MISSING_FILE), |
42 |
| - GtfsTranslationTableContainer.forStatus(GtfsTableContainer.TableStatus.PARSABLE_HEADERS_AND_ROWS) |
43 |
| - )).contains(new MissingRequiredFileNotice(GtfsFeedInfo.FILENAME)); |
44 |
| - |
| 38 | + GtfsFeedInfoTableContainer.forStatus(GtfsTableContainer.TableStatus.MISSING_FILE), |
| 39 | + GtfsTranslationTableContainer.forStatus( |
| 40 | + GtfsTableContainer.TableStatus.PARSABLE_HEADERS_AND_ROWS))) |
| 41 | + .contains(new MissingRequiredFileNotice(GtfsFeedInfo.FILENAME)); |
45 | 42 | }
|
46 | 43 | }
|
0 commit comments