-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced LocalDateTime with LocalDate to simplify date caluclation (#10)
* replaced LocalDateTime with LocalDate to simplify date caluclation * fixed tests, update dependencies + example ics Co-authored-by: paulbrejla <[email protected]>
- Loading branch information
Showing
12 changed files
with
123 additions
and
34 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package de.paulbrejla.holidays.rest | ||
|
||
import de.paulbrejla.holidays.domain.State | ||
import java.time.LocalDateTime | ||
import java.time.LocalDate | ||
|
||
data class HolidayDto(val start: String, val end: String, val year: Int, val stateCode: State, val name: String, val slug: String) |
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
4 changes: 1 addition & 3 deletions
4
src/test/kotlin/de/paulbrejla/holidays/HolidaysApiApplicationTests.kt
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
...aulbrejla/holidays/infrastructure/loader/impl/LocalFilesystemCalendarLoaderGatewayTest.kt
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 de.paulbrejla.holidays.infrastructure.loader.impl | ||
|
||
import de.paulbrejla.holidays.infrastructure.loader.api.CalendarLoader | ||
import org.junit.jupiter.api.Test | ||
|
||
import org.junit.jupiter.api.Assertions.* | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
|
||
@SpringBootTest | ||
internal class LocalFilesystemCalendarLoaderGatewayTest { | ||
|
||
@Autowired | ||
lateinit var calendarLoader: CalendarLoader | ||
|
||
@Test | ||
fun `calendar files are loaded`() { | ||
// Given | ||
val eventCount = 5 | ||
|
||
// When | ||
val calendars = calendarLoader.loadCalendarFiles() | ||
|
||
// Then | ||
assertNotNull(calendars.first().calendars) | ||
assertEquals(calendars.first().calendars.first().events.count(), eventCount) | ||
|
||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
src/test/resources/holidays/ferien_baden-wuerttemberg_2017.ics
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,52 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
CALSCALE:GREGORIAN | ||
PRODID:FERIEN_API | ||
METHOD:PUBLISH | ||
|
||
BEGIN:VEVENT | ||
DTSTAMP:20170922T052539Z | ||
UID:bdfb478f-7169-4171-ad9f-da1887f20676 | ||
DTSTART;VALUE=DATE:20170410 | ||
DTEND;VALUE=DATE:20170422 | ||
DESCRIPTION:Osterferien 2017 Baden-Württemberg | ||
SUMMARY:Osterferien | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
DTSTAMP:20170922T052539Z | ||
UID:9c25e98e-939e-4912-ae58-153cdc88a8ed | ||
DTSTART;VALUE=DATE:20170606 | ||
DTEND;VALUE=DATE:20170617 | ||
DESCRIPTION:Pfingstferien 2017 Baden-Württemberg | ||
SUMMARY:Pfingstferien | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
DTSTAMP:20170922T052539Z | ||
UID:ed7ebf1a-a8b1-4139-984f-2244b7550978 | ||
DTSTART;VALUE=DATE:20170727 | ||
DTEND;VALUE=DATE:20170910 | ||
DESCRIPTION:Sommerferien 2017 Baden-Württemberg | ||
SUMMARY:Sommerferien | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
DTSTAMP:20170922T052539Z | ||
UID:250f4e37-4ada-492e-a2d1-5b6fc3f619b7 | ||
DTSTART;VALUE=DATE:20171030 | ||
DTEND;VALUE=DATE:20171104 | ||
DESCRIPTION:Herbstferien 2017 Baden-Württemberg | ||
SUMMARY:Herbstferien | ||
END:VEVENT | ||
|
||
BEGIN:VEVENT | ||
DTSTAMP:20170922T052539Z | ||
UID:027811ca-48cb-432b-b02a-d63f0d8b842a | ||
DTSTART;VALUE=DATE:20171222 | ||
DTEND;VALUE=DATE:20180106 | ||
DESCRIPTION:Weihnachtsferien 2017 Baden-Württemberg | ||
SUMMARY:Weihnachtsferien | ||
END:VEVENT | ||
|
||
END:VCALENDAR |