Skip to content

Commit 169015f

Browse files
authored
Fix assertions to assertj.
1 parent 159520d commit 169015f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeTests.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.elasticsearch.core;
1717

18-
import static org.junit.jupiter.api.Assertions.*;
18+
import static org.assertj.core.api.Assertions.*;
1919

2020
import lombok.AllArgsConstructor;
2121
import lombok.Builder;
@@ -109,9 +109,9 @@ void shouldReturnCorrectResultsForTextString() {
109109
.collect(Collectors.toList());
110110

111111
// then
112-
assertEquals(2, result.size());
113-
assertTrue(result.contains(new SearchAsYouTypeEntity("1")));
114-
assertTrue(result.contains(new SearchAsYouTypeEntity("2")));
112+
assertThat(result).hasSize(2);
113+
assertThat(result).contains(new SearchAsYouTypeEntity("1"));
114+
assertThat(result).contains(new SearchAsYouTypeEntity("2"));
115115
}
116116

117117
@Test // DATAES-773
@@ -131,9 +131,9 @@ void shouldReturnCorrectResultsForNumQuery() {
131131
.collect(Collectors.toList());
132132

133133
// then
134-
assertEquals(2, result.size());
135-
assertTrue(result.contains(new SearchAsYouTypeEntity("2")));
136-
assertTrue(result.contains(new SearchAsYouTypeEntity("3")));
134+
assertThat(result).hasSize(2);
135+
assertThat(result).contains(new SearchAsYouTypeEntity("2"));
136+
assertThat(result).contains(new SearchAsYouTypeEntity("3"));
137137
}
138138

139139
@Test // DATAES-773
@@ -153,8 +153,8 @@ void shouldReturnCorrectResultsForNotMatchQuery() {
153153
.collect(Collectors.toList());
154154

155155
// then
156-
assertEquals(1, result.size());
157-
assertTrue(result.contains(new SearchAsYouTypeEntity("4")));
156+
assertThat(result).hasSize(1);
157+
assertThat(result).contains(new SearchAsYouTypeEntity("4"));
158158
}
159159

160160
/**

0 commit comments

Comments
 (0)