From b3d633cf0e8a6c35be9755702dedbea29ff3d897 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 4 Sep 2018 11:22:57 +0300 Subject: WebFinger support --- .../src/test/java/com/juick/server/tests/ServerTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'juick-server/src/test/java/com/juick/server') diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index b5f5143b2..9a4fb93a3 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -1320,6 +1320,16 @@ public class ServerTests { assertThat(messagesService.getMessages(AnonymousUser.INSTANCE, Collections.singletonList(mid)).get(0).getReplies(), is(1)); assertThat(messagesService.getReplies(banned, mid).size(), is(2)); assertThat(messagesService.getMessages(banned, Collections.singletonList(mid)).get(0).getReplies(), is(2)); + } + @Test + public void accountUrlsShouldBeExposedOverWebfinger() throws Exception { + mockMvc.perform(get("/.well-known/webfinger?resource=acct:ugnich@localhost")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.subject", is("acct:ugnich@localhost"))) + .andExpect(jsonPath("$.links", hasSize(2))) + .andExpect(jsonPath("$.links[0].href", is("http://localhost:8080/u/ugnich"))); + mockMvc.perform(get("/.well-known/webfinger?resource=acct:durov@localhost")) + .andExpect(status().isNotFound()); } } -- cgit v1.2.3