aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java10
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);
}