Code Review

Data and Time

?

@Test
void testGetLocalDate() {
    LocalDate actual = dataWrapper.getLocalDate(2022, 8, 3);
    int expectedYear = 2022;
    int expectedMonth = 8;
    int expectedDay = 3;

    int actualYear = actual.getYear();
    int actualMonth = actual.getMonthValue();
    int actualDay = actual.getDayOfMonth();

    Assertions.assertEquals(expectedMonth,actualMonth);
    Assertions.assertEquals(expectedDay,actualDay);
    Assertions.assertEquals(expectedYear,actualYear);
}

?

@Test
public void testAdjustInto() {
    LocalDate localDate = LocalDate.of(2010, 3, 10);
    String expected = "2010-03-20";

    String actual = temporalAdjuster.adjustInto(localDate).toString();

    Assertions.assertEquals(expected, actual);
}

?

@Test
public void testAdjustIntoPreviousFirstJanuary() {
    LocalDate localDate = LocalDate.of(2010, 3, 10);
    String expected = "2010-01-01";

    String actual = temporalAdjuster.adjustInto(localDate).toString();

    Assertions.assertEquals(expected, actual);
}

@Test
public void testAdjustIntoNextFirstJanuary() {
    LocalDate localDate = LocalDate.of(2010, 8, 10);
    String expected = "2011-01-01";

    String actual = temporalAdjuster.adjustInto(localDate).toString();

    Assertions.assertEquals(expected, actual);
}

?

?

?

?

?