List of usage examples for java.time DayOfWeek FRIDAY
DayOfWeek FRIDAY
To view the source code for java.time DayOfWeek FRIDAY.
Click Source Link
From source file:nu.yona.server.analysis.service.ActivityServiceTest.java
@Test public void getUserWeekActivityOverviews_activityPresent_resultsWithActivity() { ZonedDateTime today = getDayStartTime(ZonedDateTime.now(userAnonZone)); // gambling goal was created 2 weeks ago, see above // mock some activity in previous week on Saturday 19:10-19:55 WeekActivity previousWeekRecordedActivity = WeekActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today.minusWeeks(1)).toLocalDate()); ZonedDateTime saturdayStartOfDay = getWeekStartTime(today).minusDays(1); DayActivity previousWeekSaturdayRecordedActivity = DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, saturdayStartOfDay.toLocalDate()); Activity recordedActivity = Activity.createInstance(userAnonZone, saturdayStartOfDay.plusHours(19).plusMinutes(10).toLocalDateTime(), saturdayStartOfDay.plusHours(19).plusMinutes(55).toLocalDateTime(), Optional.empty()); previousWeekSaturdayRecordedActivity.addActivity(recordedActivity); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(7).toLocalDate())); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(6).toLocalDate())); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(5).toLocalDate())); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(4).toLocalDate())); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(3).toLocalDate())); previousWeekRecordedActivity.addDayActivity(DayActivity.createInstance(userAnonEntity, gamblingGoal, userAnonZone, getWeekStartTime(today).minusDays(2).toLocalDate())); previousWeekRecordedActivity.addDayActivity(previousWeekSaturdayRecordedActivity); when(mockWeekActivityRepository.findAll(userAnonId, getWeekStartTime(today.minusWeeks(4)).toLocalDate(), getWeekStartTime(today).plusWeeks(1).toLocalDate())) .thenReturn(new HashSet<>(Arrays.asList(previousWeekRecordedActivity))); Page<WeekActivityOverviewDto> weekOverviews = service.getUserWeekActivityOverviews(userId, new PageRequest(0, 5)); // assert that the right retrieve from database was done verify(mockWeekActivityRepository, times(1)).findAll(userAnonId, getWeekStartTime(today.minusWeeks(4)).toLocalDate(), getWeekStartTime(today).plusWeeks(1).toLocalDate()); // because the gambling goal was added with creation date two weeks ago, there are multiple weeks assertThat(weekOverviews.getNumberOfElements(), equalTo(3)); // get the current week (first item) WeekActivityOverviewDto weekOverview = weekOverviews.getContent().get(0); assertThat(weekOverview.getWeekActivities().size(), equalTo(userAnonEntity.getGoals().size())); WeekActivityDto weekActivityForGambling = weekOverview.getWeekActivities().stream() .filter(a -> a.getGoalId().equals(gamblingGoal.getId())).findAny().get(); assertThat(weekActivityForGambling.getStartTime(), equalTo(getWeekStartTime(today))); // TODO: mock day activity in this week? // int thisWeekNumberOfWeekDaysPast = today.getDayOfWeek() == DayOfWeek.SUNDAY ? 0 : today.getDayOfWeek().getValue(); // assertThat(weekActivityForGambling.getDayActivities().size(), equalTo(1 + thisWeekNumberOfWeekDaysPast)); //// always contains Sunday because it is the first day of the week // assertThat(weekActivityForGambling.getDayActivities(), hasKey(DayOfWeek.SUNDAY)); // get the previous week, with recorded activity weekOverview = weekOverviews.getContent().get(1); assertThat(weekOverview.getWeekActivities().size(), equalTo(1)); weekActivityForGambling = weekOverview.getWeekActivities().stream() .filter(a -> a.getGoalId().equals(gamblingGoal.getId())).findAny().get(); assertThat(weekActivityForGambling.getStartTime(), equalTo(getWeekStartTime(today.minusWeeks(1)))); assertThat(weekActivityForGambling.getDayActivities().size(), equalTo(7)); DayActivityDto previousWeekSaturdayActivity = weekActivityForGambling.getDayActivities() .get(DayOfWeek.SATURDAY); assertThat(previousWeekSaturdayActivity.getTotalActivityDurationMinutes().get(), equalTo(45)); assertThat(previousWeekSaturdayActivity.getTotalMinutesBeyondGoal(), equalTo(45)); DayActivityDto previousWeekFridayActivity = weekActivityForGambling.getDayActivities() .get(DayOfWeek.FRIDAY); assertThat(previousWeekFridayActivity.getTotalActivityDurationMinutes().get(), equalTo(0)); // get the week the gambling goal was created weekOverview = weekOverviews.getContent().get(2); assertThat(weekOverview.getWeekActivities().size(), equalTo(1)); weekActivityForGambling = weekOverview.getWeekActivities().stream() .filter(a -> a.getGoalId().equals(gamblingGoal.getId())).findAny().get(); assertThat(weekActivityForGambling.getStartTime(), equalTo(getWeekStartTime(today.minusWeeks(2)))); // TODO: mock day activity in this week? // int expectedNumberOfWeekDaysRecorded = gamblingGoal.getCreationTime().getDayOfWeek() == DayOfWeek.SUNDAY ? 7 // : 7 - gamblingGoal.getCreationTime().getDayOfWeek().getValue(); // assertThat(weekActivityForGambling.getDayActivities().size(), equalTo(expectedNumberOfWeekDaysRecorded)); //// always contains Saturday because it is the last day of the week // assertThat(weekActivityForGambling.getDayActivities(), hasKey(DayOfWeek.SATURDAY)); }
From source file:org.silverpeas.core.calendar.icalendar.ICal4JExchangeImportTest.java
@Test public void severalOfOneHourDurationAndDailyRecurrence() throws ImportException { CalendarEvent event1 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T12:32:00Z"), datetime("2016-12-15T13:32:00Z"))) .withExternalId("EXT-EVENT-UUID-1").withTitle("EVENT-TITLE-1").withPriority(Priority.HIGH) .withVisibilityLevel(VisibilityLevel.PRIVATE).withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence.every(TimeUnit.DAY)) .build();//from w ww .j ava2 s .c o m CalendarEvent event2 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T13:50:00Z"), datetime("2016-12-15T14:50:00Z"))) .withExternalId("EVENT-UUID-2").withTitle("EVENT-TITLE-2") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(3, TimeUnit.DAY)).build(); CalendarEvent event3 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T15:27:00Z"), datetime("2016-12-15T16:27:00Z"))) .withExternalId("EVENT-UUID-3").withTitle("EVENT-TITLE-3") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(4, TimeUnit.DAY).until(datetime("2016-12-31T15:27:00Z"))).build(); CalendarEvent event4 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T18:45:00Z"), datetime("2016-12-15T20:15:00Z"))) .withExternalId("EVENT-UUID-4").withTitle("EVENT-TITLE-4") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(2, TimeUnit.DAY).until(10)).build(); CalendarEvent event5 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T20:00:00Z"), datetime("2016-12-15T20:15:00Z"))) .withExternalId("EVENT-UUID-5").withTitle("EVENT-TITLE-5") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.DAY).excludeEventOccurrencesStartingAt(date("2016-12-18"), date("2016-12-20"), date("2016-12-25"))) .build(); CalendarEvent event6 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T20:30:00Z"), datetime("2016-12-15T20:45:00Z"))) .withExternalId("EVENT-UUID-6").withTitle("EVENT-TITLE-6") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence .every(2, TimeUnit.WEEK).on(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) .build(); CalendarEvent event7 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:00:00Z"), datetime("2016-12-15T21:15:00Z"))) .withExternalId("EVENT-UUID-7").withTitle("EVENT-TITLE-7") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence( Recurrence.every(1, TimeUnit.MONTH).on(DayOfWeekOccurrence.nth(3, DayOfWeek.FRIDAY))) .build(); CalendarEvent event8 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:15:00Z"), datetime("2016-12-15T21:30:00Z"))) .withExternalId("EVENT-UUID-8").withTitle("EVENT-TITLE-8") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.MONTH)).build(); CalendarEvent event9 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:45:00Z"), datetime("2016-12-15T22:00:00Z"))) .withExternalId("EVENT-UUID-9").withTitle("EVENT-TITLE-9") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.YEAR)).build(); importAndVerifyResult("ical4j_import_several_with_recurrence.txt", asList(event1, event2, event3, event4, event5, event6, event7, event8, event9), defaultAssert); }
From source file:org.silverpeas.core.calendar.icalendar.ICal4JExchangeImportTest.java
@Test public void severalOnAllDaysAndDailyRecurrence() throws ImportException { CalendarEvent event1 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EXT-EVENT-UUID-1").withTitle("EVENT-TITLE-1") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence.every(TimeUnit.DAY)) .build();/*from w ww . ja v a 2 s.c om*/ CalendarEvent event2 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-2").withTitle("EVENT-TITLE-2") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(3, TimeUnit.DAY)).build(); CalendarEvent event3 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-3").withTitle("EVENT-TITLE-3") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(4, TimeUnit.DAY).until(date("2016-12-31"))).build(); CalendarEvent event4 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-4").withTitle("EVENT-TITLE-4") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(2, TimeUnit.DAY).until(10)).build(); CalendarEvent event5 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-5").withTitle("EVENT-TITLE-5") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.DAY).excludeEventOccurrencesStartingAt(date("2016-12-18"), date("2016-12-20"), date("2016-12-25"))) .build(); CalendarEvent event6 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-6").withTitle("EVENT-TITLE-6") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence .every(2, TimeUnit.WEEK).on(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) .build(); CalendarEvent event7 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-7").withTitle("EVENT-TITLE-7") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence( Recurrence.every(1, TimeUnit.MONTH).on(DayOfWeekOccurrence.nth(3, DayOfWeek.FRIDAY))) .build(); CalendarEvent event8 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-8").withTitle("EVENT-TITLE-8") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.MONTH)).build(); CalendarEvent event9 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-15"))) .withExternalId("EVENT-UUID-9").withTitle("EVENT-TITLE-9") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.YEAR)).build(); importAndVerifyResult("ical4j_import_several_with_recurrence_on_all_day.txt", asList(event1, event2, event3, event4, event5, event6, event7, event8, event9), defaultAssert); }
From source file:org.silverpeas.core.calendar.icalendar.ICal4JExporterTest.java
@Test public void severalOfOneHourDurationAndDailyRecurrence() throws ExportException { CalendarEvent event1 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T12:32:00Z"), datetime("2016-12-15T13:32:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-1").withExternalId("EXT-EVENT-UUID-1") .withTitle("EVENT-TITLE-1").withPriority(Priority.HIGH).withVisibilityLevel(PRIVATE) .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence.every(TimeUnit.DAY)) .build();//from w ww .j ava 2s. com CalendarEvent event2 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T13:50:00Z"), datetime("2016-12-15T14:50:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-2").withTitle("EVENT-TITLE-2") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(3, TimeUnit.DAY)).build(); CalendarEvent event3 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T15:27:00Z"), datetime("2016-12-15T16:27:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-3").withTitle("EVENT-TITLE-3") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(4, TimeUnit.DAY).until(datetime("2016-12-31T15:27:00Z"))).build(); CalendarEvent event4 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T18:45:00Z"), datetime("2016-12-15T20:15:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-4").withTitle("EVENT-TITLE-4") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(2, TimeUnit.DAY).until(10)).build(); CalendarEvent event5 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T20:00:00Z"), datetime("2016-12-15T20:15:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-5").withTitle("EVENT-TITLE-5") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.DAY).excludeEventOccurrencesStartingAt(date("2016-12-18"), date("2016-12-20"), date("2016-12-25"))) .build(); CalendarEvent event6 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T20:30:00Z"), datetime("2016-12-15T20:45:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-6").withTitle("EVENT-TITLE-6") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence .every(2, TimeUnit.WEEK).on(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) .build(); CalendarEvent event7 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:00:00Z"), datetime("2016-12-15T21:15:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-7").withTitle("EVENT-TITLE-7") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence( Recurrence.every(1, TimeUnit.MONTH).on(DayOfWeekOccurrence.nth(3, DayOfWeek.FRIDAY))) .build(); CalendarEvent event8 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:15:00Z"), datetime("2016-12-15T21:30:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-8").withTitle("EVENT-TITLE-8") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.MONTH)).build(); CalendarEvent event9 = CalendarEventStubBuilder .from(Period.between(datetime("2016-12-15T21:45:00Z"), datetime("2016-12-15T22:00:00Z"))) .plannedOn(calendar).withId("EVENT-UUID-9").withTitle("EVENT-TITLE-9") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.YEAR)).build(); exportAndVerifyResult(newExportDescriptor(), asList(event1, event2, event3, event4, event5, event6, event7, event8, event9), "ical4j_export_several_with_recurrence.txt"); }
From source file:org.silverpeas.core.calendar.icalendar.ICal4JExporterTest.java
@Test public void severalOnAllDaysAndDailyRecurrence() throws ExportException { CalendarEvent event1 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-1").withExternalId("EXT-EVENT-UUID-1") .withTitle("EVENT-TITLE-1").withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence.every(TimeUnit.DAY)) .build();//from ww w .j a v a2s .c o m CalendarEvent event2 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-2").withTitle("EVENT-TITLE-2") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(3, TimeUnit.DAY)).build(); CalendarEvent event3 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-3").withTitle("EVENT-TITLE-3") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(4, TimeUnit.DAY).until(date("2016-12-31"))).build(); CalendarEvent event4 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-4").withTitle("EVENT-TITLE-4") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(2, TimeUnit.DAY).until(10)).build(); CalendarEvent event5 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-5").withTitle("EVENT-TITLE-5") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.DAY).excludeEventOccurrencesStartingAt(date("2016-12-18"), date("2016-12-20"), date("2016-12-25"))) .build(); CalendarEvent event6 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-6").withTitle("EVENT-TITLE-6") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")).withRecurrence(Recurrence .every(2, TimeUnit.WEEK).on(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) .build(); CalendarEvent event7 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-7").withTitle("EVENT-TITLE-7") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence( Recurrence.every(1, TimeUnit.MONTH).on(DayOfWeekOccurrence.nth(3, DayOfWeek.FRIDAY))) .build(); CalendarEvent event8 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-8").withTitle("EVENT-TITLE-8") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.MONTH)).build(); CalendarEvent event9 = CalendarEventStubBuilder.from(Period.between(date("2016-12-15"), date("2016-12-16"))) .plannedOn(calendar).withId("EVENT-UUID-9").withTitle("EVENT-TITLE-9") .withCreationDate(datetime("2016-12-01T14:30:00Z")) .withLastUpdateDate(datetime("2016-12-02T09:00:00Z")) .withRecurrence(Recurrence.every(TimeUnit.YEAR)).build(); exportAndVerifyResult(newExportDescriptor(), asList(event1, event2, event3, event4, event5, event6, event7, event8, event9), "ical4j_export_several_with_recurrence_on_all_day.txt"); }