JAVA-617 Split or move core-java-datetime-java8 module
This commit is contained in:
parent
13ce413ed2
commit
ddf9da34bf
|
@ -1,3 +1,5 @@
|
||||||
### Relevant Articles:
|
### Relevant Articles:
|
||||||
|
|
||||||
|
- [Generating Random Dates in Java](https://www.baeldung.com/java-random-dates)
|
||||||
- [Creating a LocalDate with Values in Java](https://www.baeldung.com/java-creating-localdate-with-values)
|
- [Creating a LocalDate with Values in Java](https://www.baeldung.com/java-creating-localdate-with-values)
|
||||||
|
- [[<-- Prev]](/core-java-modules/core-java-datetime-java8-1)
|
|
@ -11,31 +11,31 @@ public class LocalDateExampleUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValues_whenUsingOfMethod_thenLocalDate() {
|
public void givenValues_whenUsingOfMethod_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getCustomDateOne(2020, 1, 8));
|
assertEquals("2020-01-08", date.getCustomDateOne(2020, 1, 8).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValuesWithMonthEnum_whenUsingOfMethod_thenLocalDate() {
|
public void givenValuesWithMonthEnum_whenUsingOfMethod_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getCustomDateTwo(2020, Month.JANUARY, 8));
|
assertEquals("2020-01-08", date.getCustomDateTwo(2020, Month.JANUARY, 8).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValues_whenUsingEpochDay_thenLocalDate() {
|
public void givenValues_whenUsingEpochDay_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getDateFromEpochDay(18269));
|
assertEquals("2020-01-08", date.getDateFromEpochDay(18269).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValues_whenUsingYearDay_thenLocalDate() {
|
public void givenValues_whenUsingYearDay_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getDateFromYearAndDayOfYear(2020, 8));
|
assertEquals("2020-01-08", date.getDateFromYearAndDayOfYear(2020, 8).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValues_whenUsingParse_thenLocalDate() {
|
public void givenValues_whenUsingParse_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getDateFromString("2020-01-08"));
|
assertEquals("2020-01-08", date.getDateFromString("2020-01-08").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValuesWithFormatter_whenUsingParse_thenLocalDate() {
|
public void givenValuesWithFormatter_whenUsingParse_thenLocalDate() {
|
||||||
assertEquals("2020-01-08", date.getDateFromStringAndFormatter("8-Jan-2020", "d-MMM-yyyy"));
|
assertEquals("2020-01-08", date.getDateFromStringAndFormatter("8-Jan-2020", "d-MMM-yyyy").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,4 @@ This module contains articles about the Date and Time API introduced with Java 8
|
||||||
- [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end)
|
- [How to Get the Start and the End of a Day using Java](http://www.baeldung.com/java-day-start-end)
|
||||||
- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone)
|
- [Set the Time Zone of a Date in Java](https://www.baeldung.com/java-set-date-time-zone)
|
||||||
- [Comparing Dates in Java](https://www.baeldung.com/java-comparing-dates)
|
- [Comparing Dates in Java](https://www.baeldung.com/java-comparing-dates)
|
||||||
- [Generating Random Dates in Java](https://www.baeldung.com/java-random-dates)
|
- [[Next -->]](/core-java-modules/core-java-datetime-java8-2)
|
||||||
|
|
Loading…
Reference in New Issue