Skip to content

Commit 060d159

Browse files
author
Grzegorz Piwowarek
committed
Formatting
1 parent 0334f06 commit 060d159

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

‎assertj/src/test/java/com/baeldung/assertj/introduction/AssertJJava8Test.java‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ public void givenOptional_shouldAssert() throws Exception {
2121
final Optional<String> givenOptional = Optional.of("something");
2222

2323
assertThat(givenOptional)
24-
.isPresent()
25-
.hasValue("something");
24+
.isPresent()
25+
.hasValue("something");
2626
}
2727

2828
@Test
2929
public void givenPredicate_shouldAssert() throws Exception {
3030
final Predicate<String> predicate = s -> s.length() > 4;
3131

3232
assertThat(predicate)
33-
.accepts("aaaaa", "bbbbb")
34-
.rejects("a", "b")
35-
.acceptsAll(asList("aaaaa", "bbbbb"))
36-
.rejectsAll(asList("a", "b"));
33+
.accepts("aaaaa", "bbbbb")
34+
.rejects("a", "b")
35+
.acceptsAll(asList("aaaaa", "bbbbb"))
36+
.rejectsAll(asList("a", "b"));
3737
}
3838

3939
@Test
@@ -42,72 +42,72 @@ public void givenLocalDate_shouldAssert() throws Exception {
4242
final LocalDate todayDate = LocalDate.now();
4343

4444
assertThat(givenLocalDate)
45-
.isBefore(LocalDate.of(2020, 7, 8))
46-
.isAfterOrEqualTo(LocalDate.of(1989, 7, 8));
45+
.isBefore(LocalDate.of(2020, 7, 8))
46+
.isAfterOrEqualTo(LocalDate.of(1989, 7, 8));
4747

4848
assertThat(todayDate)
49-
.isAfter(LocalDate.of(1989, 7, 8))
50-
.isToday();
49+
.isAfter(LocalDate.of(1989, 7, 8))
50+
.isToday();
5151
}
5252

5353
@Test
5454
public void givenLocalDateTime_shouldAssert() throws Exception {
5555
final LocalDateTime givenLocalDate = LocalDateTime.of(2016, 7, 8, 12, 0);
5656

5757
assertThat(givenLocalDate)
58-
.isBefore(LocalDateTime.of(2020, 7, 8, 11, 2));
58+
.isBefore(LocalDateTime.of(2020, 7, 8, 11, 2));
5959
}
6060

6161
@Test
6262
public void givenLocalTime_shouldAssert() throws Exception {
6363
final LocalTime givenLocalTime = LocalTime.of(12, 15);
6464

6565
assertThat(givenLocalTime)
66-
.hasSameHourAs(LocalTime.of(12, 0));
66+
.hasSameHourAs(LocalTime.of(12, 0));
6767
}
6868

6969
@Test
7070
public void givenList_shouldAssertFlatExtracting() throws Exception {
7171
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
7272

7373
assertThat(givenList)
74-
.flatExtracting(LocalDate::getYear)
75-
.contains(2015);
74+
.flatExtracting(LocalDate::getYear)
75+
.contains(2015);
7676
}
7777

7878
@Test
7979
public void givenList_shouldAssertMultipleFlatExtracting() throws Exception {
8080
final List<LocalDate> givenList = asList(ofYearDay(2016, 5), ofYearDay(2015, 6));
8181

8282
assertThat(givenList)
83-
.flatExtracting(LocalDate::getYear, LocalDate::getDayOfMonth)
84-
.contains(2015, 6);
83+
.flatExtracting(LocalDate::getYear, LocalDate::getDayOfMonth)
84+
.contains(2015, 6);
8585
}
8686

8787
@Test
8888
public void givenString_shouldSatisfy() throws Exception {
8989
final String givenString = "someString";
9090

9191
assertThat(givenString)
92-
.satisfies(s -> {
93-
assertThat(s).isNotEmpty();
94-
assertThat(s).hasSize(10);
95-
});
92+
.satisfies(s -> {
93+
assertThat(s).isNotEmpty();
94+
assertThat(s).hasSize(10);
95+
});
9696
}
9797

9898
@Test
9999
public void givenString_shouldMatch() throws Exception {
100100
final String givenString = "";
101101

102102
assertThat(givenString)
103-
.matches(String::isEmpty);
103+
.matches(String::isEmpty);
104104
}
105105

106106
@Test
107107
public void givenList_shouldHasOnlyOneElementSatisfying() throws Exception {
108108
final List<String> givenList = Arrays.asList("");
109109

110110
assertThat(givenList)
111-
.hasOnlyOneElementSatisfying(s -> assertThat(s).isEmpty());
111+
.hasOnlyOneElementSatisfying(s -> assertThat(s).isEmpty());
112112
}
113113
}

0 commit comments

Comments
 (0)