From 2a858017b7d9a620d1083b69b7ca038c34a5ba89 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 24 Dec 2022 03:15:44 +0300 Subject: `Collectors.toList()` -> `toList()` --- src/test/java/com/juick/server/tests/ServerTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test/java/com/juick') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 89c3b089..afc874f4 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1260,7 +1260,7 @@ public class ServerTests { String tagsString = "test test" + (char) 0xA0 + "2 test 3"; Set tags = MessageUtils.parseTags(tagsString); List tagList = tags.stream().map(t -> tagService.getTag(t.getName(), true)) - .collect(Collectors.toList()); + .toList(); assertEquals("test", tagList.get(0).getName()); assertEquals("test 3", tagList.get(2).getName()); assertEquals(3, tagList.size()); @@ -1700,14 +1700,14 @@ public class ServerTests { assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(4)); assertThat(CollectionUtils.isEqualCollection( messagesService.getMessagesRecommendations(Collections.singletonList(mid)).stream() - .map(p -> p.getRight()).map(User::getName).collect(Collectors.toList()), + .map(Pair::getRight).map(User::getName).toList(), Arrays.asList("fmap", "ermine", "pogo", "Anonymous")), is(true)); privacyQueriesService.blacklistUser(userService.getUserByName("monstreek"), userService.getUserByName("pogo")); assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(3)); assertThat(CollectionUtils.isEqualCollection( messagesService.getMessagesRecommendations(Collections.singletonList(mid)).stream() - .map(p -> p.getRight()).map(User::getName).collect(Collectors.toList()), + .map(Pair::getRight).map(User::getName).toList(), Arrays.asList("fmap", "ermine", "Anonymous")), is(true)); jdbcTemplate.execute("DELETE FROM favorites"); } @@ -1761,7 +1761,7 @@ public class ServerTests { i -> messagesService.createMessage(ugnich.getUid(), String.format("message %d", i), null, Set.of())) .collect(Collectors.toCollection(ArrayDeque::new)).descendingIterator()); - List midsPage = mids.stream().limit(20).collect(Collectors.toList()); + List midsPage = mids.stream().limit(20).toList(); mockMvc.perform(get("/u/ugnich/blog").accept(Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE)) .andExpect(status().isOk()).andExpect(jsonPath("$.orderedItems", hasSize(20))) .andExpect(jsonPath("$.next", @@ -1929,7 +1929,7 @@ public class ServerTests { .map(i -> messagesService.createMessage(ugnich.getUid(), String.valueOf(i), null, Set.of())) .boxed() - .collect(Collectors.toList()); + .toList(); for (Integer m : newMids) { subscriptionService.subscribeMessage(messagesService.getMessage(m).get(), freefd); } -- cgit v1.2.3