aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-02-23 18:26:05 +0300
committerGravatar Vitaly Takmazov2019-02-23 18:26:05 +0300
commit116d87c9473b8135d0466be149f070e067e8b810 (patch)
tree0ab85186dd1554c7fd3d2d39c6b606416bf1bb09 /src/test/java/com
parent42af5984ef2decf3763fab51f274fd9940ec23c7 (diff)
* Add text descriptions to ActivityPub error codes
* Append ActivityPub attachments as urls * Added failing test for Hubzilla activity with Link as object
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 9e1e68ea..b1a71c65 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -44,6 +44,7 @@ import com.juick.server.util.ImageUtils;
import com.juick.server.www.WebApp;
import com.juick.service.*;
import com.juick.service.component.MessageEvent;
+import com.juick.test.util.MockUtils;
import com.juick.util.DateFormattersHolder;
import com.juick.util.MessageUtils;
import com.mitchellbosecke.pebble.PebbleEngine;
@@ -209,6 +210,8 @@ public class ServerTests {
private Resource cmykJpeg;
@Value("classpath:nojfif.jpg")
private Resource nojfif;
+ @Value("classpath:hubzilla_activity.json")
+ private Resource hubzillaActivity;
@Inject
private KeystoreManager testKeystoreManager;
@@ -1932,4 +1935,22 @@ public class ServerTests {
.andExpect(status().isAccepted());
apClient.setRequestFactory(originalRequestFactory);
}
+
+ @Test
+ public void legacyAvatarEndpoint() throws Exception {
+ mockMvc.perform(get("/api/avatar")
+ .param("uname", "unknown"))
+ .andExpect(status().isOk())
+ .andExpect(content().bytes(IOUtils.toByteArray(defaultAvatar.getInputStream())));
+ }
+ @Test
+ public void federatedAttachmentsAsLinks() throws Exception {
+ int mid = messagesService.createMessage(ugnich.getUid(), "test", StringUtils.EMPTY, Collections.emptyList());
+ Message testMessage = MockUtils.mockMessage(mid, freefd, "reply");
+ }
+ @Test
+ public void hubzillaActor() throws Exception {
+ String activity = IOUtils.toString(hubzillaActivity.getInputStream(), StandardCharsets.UTF_8);
+ Create create = jsonMapper.readValue(activity, Create.class);
+ }
}