Add additional examples
This commit is contained in:
parent
060d1594aa
commit
79e2c3ed49
@ -63,6 +63,7 @@ public class AssertJJava8Test {
|
|||||||
final LocalTime givenLocalTime = LocalTime.of(12, 15);
|
final LocalTime givenLocalTime = LocalTime.of(12, 15);
|
||||||
|
|
||||||
assertThat(givenLocalTime)
|
assertThat(givenLocalTime)
|
||||||
|
.isAfter(LocalTime.of(1, 0))
|
||||||
.hasSameHourAs(LocalTime.of(12, 0));
|
.hasSameHourAs(LocalTime.of(12, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +76,24 @@ public class AssertJJava8Test {
|
|||||||
.contains(2015);
|
.contains(2015);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenList_shouldAssertFlatExtractingLeapYear() throws Exception {
|
||||||
|
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
|
||||||
|
|
||||||
|
assertThat(givenList)
|
||||||
|
.flatExtracting(LocalDate::isLeapYear)
|
||||||
|
.contains(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenList_shouldAssertFlatExtractingClass() throws Exception {
|
||||||
|
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
|
||||||
|
|
||||||
|
assertThat(givenList)
|
||||||
|
.flatExtracting(Object::getClass)
|
||||||
|
.contains(LocalDate.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenList_shouldAssertMultipleFlatExtracting() throws Exception {
|
public void givenList_shouldAssertMultipleFlatExtracting() throws Exception {
|
||||||
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
|
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user