@@ -71,7 +71,6 @@ class RankingV1ApiE2ETest {
7171 @ Autowired
7272 private CacheKeyGenerator cacheKeyGenerator ;
7373
74- private Long testBrandId ;
7574 private final List <Long > testProductIds = new ArrayList <>();
7675 private LocalDate today ;
7776
@@ -80,7 +79,7 @@ void setUp() {
8079 databaseCleanUp .truncateAllTables ();
8180 redisCleanUp .truncateAll ();
8281 testProductIds .clear ();
83- testBrandId = null ;
82+ Long testBrandId = null ;
8483
8584 today = LocalDate .now ();
8685
@@ -141,9 +140,9 @@ void should_return_products_in_ranking_order() {
141140 assertAll (
142141 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
143142 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().content ()).hasSize (3 ),
144- () -> assertThat (response .getBody ().data ().content ().get (0 ).productId ()).isEqualTo (product1 ),
143+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().content ().get (0 ).productId ()).isEqualTo (product1 ),
145144 () -> assertThat (response .getBody ().data ().content ().get (2 ).productId ()).isEqualTo (product2 ),
146- () -> assertThat (response .getBody ().data ().content ().get (1 ).productId ()).isEqualTo (product3 )
145+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().content ().get (1 ).productId ()).isEqualTo (product3 )
147146 );
148147 }
149148
@@ -165,7 +164,7 @@ void should_return_empty_when_no_ranking_data() {
165164 assertAll (
166165 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
167166 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().content ()).isEmpty (),
168- () -> assertThat (response .getBody ().data ().totalElements ()).isEqualTo (0 )
167+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().totalElements ()).isEqualTo (0 )
169168 );
170169 }
171170
@@ -197,10 +196,10 @@ void should_paginate_ranking_results() {
197196 assertAll (
198197 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
199198 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().content ()).hasSize (2 ),
200- () -> assertThat (response .getBody ().data ().totalElements ()).isEqualTo (5 ),
201- () -> assertThat (response .getBody ().data ().totalPages ()).isEqualTo (3 ),
202- () -> assertThat (response .getBody ().data ().first ()).isTrue (),
203- () -> assertThat (response .getBody ().data ().last ()).isFalse ()
199+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().totalElements ()).isEqualTo (5 ),
200+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().totalPages ()).isEqualTo (3 ),
201+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().first ()).isTrue (),
202+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().last ()).isFalse ()
204203 );
205204 }
206205
@@ -229,7 +228,7 @@ void should_return_ranking_for_specific_date() {
229228 assertAll (
230229 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
231230 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().content ()).hasSize (1 ),
232- () -> assertThat (response .getBody ().data ().content ().get (0 ).productId ()).isEqualTo (product1 )
231+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().content ().get (0 ).productId ()).isEqualTo (product1 )
233232 );
234233 }
235234 }
@@ -263,7 +262,7 @@ void should_fallback_to_yesterday_when_today_is_empty() {
263262 assertAll (
264263 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
265264 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().content ()).hasSize (1 ),
266- () -> assertThat (response .getBody ().data ().content ().get (0 ).productId ()).isEqualTo (product1 )
265+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().content ().get (0 ).productId ()).isEqualTo (product1 )
267266 );
268267 }
269268
@@ -325,9 +324,9 @@ void should_include_ranking_info_for_ranked_product() {
325324 assertAll (
326325 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
327326 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().productId ()).isEqualTo (productId ),
328- () -> assertThat (response .getBody ().data ().ranking ()).isNotNull (),
329- () -> assertThat (response .getBody ().data ().ranking ().rank ()).isEqualTo (1L ),
330- () -> assertThat (response .getBody ().data ().ranking ().score ()).isGreaterThan (0 )
327+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ()).isNotNull (),
328+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ().rank ()).isEqualTo (1L ),
329+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ().score ()).isGreaterThan (0 )
331330 );
332331 }
333332
@@ -350,7 +349,7 @@ void should_have_null_ranking_for_unranked_product() {
350349 assertAll (
351350 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
352351 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().productId ()).isEqualTo (productId ),
353- () -> assertThat (response .getBody ().data ().ranking ()).isNull ()
352+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ()).isNull ()
354353 );
355354 }
356355
@@ -382,8 +381,8 @@ void should_return_correct_rank_among_multiple_products() {
382381 assertAll (
383382 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
384383 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().productId ()).isEqualTo (product2 ),
385- () -> assertThat (response .getBody ().data ().ranking ()).isNotNull (),
386- () -> assertThat (response .getBody ().data ().ranking ().rank ()).isEqualTo (2L )
384+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ()).isNotNull (),
385+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ().rank ()).isEqualTo (2L )
387386 );
388387 }
389388 }
@@ -424,7 +423,7 @@ void should_accumulate_scores_for_same_product() {
424423 assertAll (
425424 () -> assertThat (response .getStatusCode ()).isEqualTo (HttpStatus .OK ),
426425 () -> assertThat (Objects .requireNonNull (response .getBody ()).data ().ranking ()).isNotNull (),
427- () -> assertThat (response .getBody ().data ().ranking ().score ()).isGreaterThanOrEqualTo (5.0 )
426+ () -> assertThat (Objects . requireNonNull ( response .getBody () ).data ().ranking ().score ()).isGreaterThanOrEqualTo (5.0 )
428427 );
429428 }
430429 }
0 commit comments