Skip to content

Commit 2e5692b

Browse files
authored
Update CurrentDateTImeUnitTest.kt
fix test as calendar month values start with 0, and LocalDateTime start with 1
1 parent 1df5d91 commit 2e5692b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core-kotlin-modules/core-kotlin-date-time/src/test/kotlin/com/baeldung/currentdatetime/CurrentDateTImeUnitTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CurrentDateTImeUnitTest {
5353

5454
val current = LocalDateTime.of(
5555
calendar.get(Calendar.YEAR),
56-
calendar.get(Calendar.MONTH),
56+
calendar.get(Calendar.MONTH + 1),
5757
calendar.get(Calendar.DAY_OF_MONTH),
5858
calendar.get(Calendar.HOUR_OF_DAY),
5959
calendar.get(Calendar.MINUTE),
@@ -72,4 +72,4 @@ class CurrentDateTImeUnitTest {
7272

7373
Assertions.assertThat(current).isNotNull()
7474
}
75-
}
75+
}

0 commit comments

Comments
 (0)