diff options
author | Vitaly Takmazov | 2022-12-24 03:15:44 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-24 03:15:44 +0300 |
commit | 2a858017b7d9a620d1083b69b7ca038c34a5ba89 (patch) | |
tree | 3b192b9ab0aee2a38bbd3243a2977409ae6a033e /src/test/java/com/juick/server/tests/ServerTests.java | |
parent | 54f27794e7fee1113115baafe1b86fdbcde8e7c2 (diff) |
`Collectors.toList()` -> `toList()`
Diffstat (limited to 'src/test/java/com/juick/server/tests/ServerTests.java')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 10 |
1 files changed, 5 insertions, 5 deletions
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<Tag> tags = MessageUtils.parseTags(tagsString); List<Tag> 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<Integer> midsPage = mids.stream().limit(20).collect(Collectors.toList()); + List<Integer> 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); } |