Skip to content

Commit

Permalink
Java formatting changes from ./gradlew goJF.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyhunsaker committed Jan 12, 2024
1 parent b35bf86 commit c60be84
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class WholeFeedValidator extends FileValidator {

@Inject
public WholeFeedValidator(
GtfsFeedContainer feedContainer, CountryCode countryCode, DateForValidation dateForValidation) {
GtfsFeedContainer feedContainer,
CountryCode countryCode,
DateForValidation dateForValidation) {
this.feedContainer = feedContainer;
this.countryCode = countryCode;
this.dateForValidation = dateForValidation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ public class FeedExpirationDateValidator extends SingleEntityValidator<GtfsFeedI
public void validate(GtfsFeedInfo entity, NoticeContainer noticeContainer) {
if (entity.hasFeedEndDate()) {
GtfsDate currentDate = GtfsDate.fromLocalDate(dateForValidation.getDate());
GtfsDate currentDatePlusSevenDays = GtfsDate.fromLocalDate(dateForValidation.getDate().plusDays(7));
GtfsDate currentDatePlusThirtyDays = GtfsDate.fromLocalDate(dateForValidation.getDate().plusDays(30));
GtfsDate currentDatePlusSevenDays =
GtfsDate.fromLocalDate(dateForValidation.getDate().plusDays(7));
GtfsDate currentDatePlusThirtyDays =
GtfsDate.fromLocalDate(dateForValidation.getDate().plusDays(30));
if (entity.feedEndDate().compareTo(currentDatePlusSevenDays) <= 0) {
noticeContainer.addValidationNotice(
new FeedExpirationDate7DaysNotice(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ private List<ValidationNotice> validateSimpleServiceWindow(

var validator =
new DateTripsValidator(
new DateForValidation(TEST_NOW), dateTable, calendarTable, tripContainer, frequencyTable);
new DateForValidation(TEST_NOW),
dateTable,
calendarTable,
tripContainer,
frequencyTable);

validator.validate(noticeContainer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ private GtfsFeedInfo createFeedInfo(GtfsDate feedEndDate) {

@Test
public void feedExpiringInFiveDaysFromNowShouldGenerateNotice() {
assertThat(
validateFeedInfo(
createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(3)))))
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(3)))))
.containsExactly(
new FeedExpirationDate7DaysNotice(
1,
Expand All @@ -64,9 +62,7 @@ public void feedExpiringInFiveDaysFromNowShouldGenerateNotice() {

@Test
public void feedExpiringInSevenDaysFromNowShouldGenerateNotice() {
assertThat(
validateFeedInfo(
createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(7)))))
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(7)))))
.containsExactly(
new FeedExpirationDate7DaysNotice(
1,
Expand All @@ -77,9 +73,7 @@ public void feedExpiringInSevenDaysFromNowShouldGenerateNotice() {

@Test
public void feedExpiring7to30DaysFromNowShouldGenerateNotice() {
assertThat(
validateFeedInfo(
createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(23)))))
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(23)))))
.containsExactly(
new FeedExpirationDate30DaysNotice(
1,
Expand All @@ -90,9 +84,7 @@ public void feedExpiring7to30DaysFromNowShouldGenerateNotice() {

@Test
public void feedExpiring30DaysFromNowShouldGenerateNotice() {
assertThat(
validateFeedInfo(
createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(30)))))
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(30)))))
.containsExactly(
new FeedExpirationDate30DaysNotice(
1,
Expand All @@ -103,9 +95,7 @@ public void feedExpiring30DaysFromNowShouldGenerateNotice() {

@Test
public void feedExpiringInMoreThan30DaysFromNowShouldNotGenerateNotice() {
assertThat(
validateFeedInfo(
createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(45)))))
assertThat(validateFeedInfo(createFeedInfo(GtfsDate.fromLocalDate(TEST_NOW.plusDays(45)))))
.isEmpty();
}
}

0 comments on commit c60be84

Please sign in to comment.