Skip to content

Commit

Permalink
remove "feedContactEmail" and "feedContactUrl" as they are either nul…
Browse files Browse the repository at this point in the history
…l or empty in the case of MissingFeedContactEmailAndUrlNotice
  • Loading branch information
qcdyx committed Jun 28, 2023
1 parent cfe33b4 commit d078119
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public void validate(GtfsFeedInfo entity, NoticeContainer noticeContainer) {
if (!entity.hasFeedContactEmail() && !entity.hasFeedContactUrl()
|| entity.feedContactEmail().isBlank() && entity.feedContactUrl().isBlank()) {
noticeContainer.addValidationNotice(
new MissingFeedContactEmailAndUrlNotice(
entity.csvRowNumber(), entity.feedContactEmail(), entity.feedContactUrl()));
new MissingFeedContactEmailAndUrlNotice(entity.csvRowNumber()));
}
}

Expand All @@ -52,17 +51,8 @@ static class MissingFeedContactEmailAndUrlNotice extends ValidationNotice {
/** The row number of the validated record. */
private final int rowNumber;

/** The email contact information of a feed. */
private final String feedContactEmail;

/** The url contact information of a feed. */
private final String feedContactUrl;

MissingFeedContactEmailAndUrlNotice(
int rowNumber, String feedContactEmail, String feedContactUrl) {
MissingFeedContactEmailAndUrlNotice(int rowNumber) {
this.rowNumber = rowNumber;
this.feedContactEmail = feedContactEmail;
this.feedContactUrl = feedContactUrl;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,6 @@ public void nonFeedContactEmailAndUrlShouldGenerateNotice() {
FeedContactValidator underTest = new FeedContactValidator();
underTest.validate(entity, noticeContainer);
assertThat(noticeContainer.getValidationNotices())
.containsExactly(new FeedContactValidator.MissingFeedContactEmailAndUrlNotice(2, "", ""));
.containsExactly(new FeedContactValidator.MissingFeedContactEmailAndUrlNotice(2));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ public void testNoticeClassFieldNames() {
"tripIdB",
"tripIdFieldName",
"validator",
"value",
"feedContactEmail",
"feedContactUrl");
"value");
}

private static List<String> discoverValidationNoticeFieldNames() {
Expand Down

0 comments on commit d078119

Please sign in to comment.