aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java16
1 files changed, 15 insertions, 1 deletions
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 49988097..4d93470d 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
@@ -33,6 +33,7 @@ import com.juick.model.TagStats;
import com.juick.server.*;
import com.juick.server.api.activity.model.Context;
import com.juick.server.api.activity.model.Key;
+import com.juick.server.api.activity.model.Note;
import com.juick.server.api.activity.model.Person;
import com.juick.server.api.activity.model.activities.Create;
import com.juick.server.api.activity.model.activities.Delete;
@@ -198,6 +199,8 @@ public class ServerTests {
private String appId;
@Inject
private SignatureManager signatureManager;
+ @Inject
+ private ActivityPubManager activityPubManager;
private static User ugnich, freefd, juick;
static String ugnichName, ugnichPassword, freefdName, freefdPassword, juickName, juickPassword;
@@ -1699,7 +1702,18 @@ public class ServerTests {
String attachment = attachmentObj != null ? (String)attachmentObj.get("url") : StringUtils.EMPTY;
String deleteJsonStr = IOUtils.toString(URI.create("classpath:delete.json"), StandardCharsets.UTF_8);
Delete delete = jsonMapper.readValue(deleteJsonStr, Delete.class);
-
+ int mid = messagesService.createMessage(ugnich.getUid(), "YO", "", null);
+ User extUser = new User();
+ extUser.setUri(URI.create("https://ext.social/users/xwatt"));
+ int rid = messagesService.createReply(mid, 0, extUser, "PEOPLE", null);
+ Message replyFromExt = messagesService.getReply(mid, rid);
+ String extMessageUri = "https://ext.social/statuses/12345";
+ messagesService.updateReplyUri(replyFromExt, URI.create(extMessageUri));
+ int rid2 = messagesService.createReply(mid, rid, ugnich, "HI", null);
+
+ Message replyToExt = messagesService.getReply(mid, rid2);
+ Note replyNote = activityPubManager.makeNote(replyToExt);
+ assertThat(replyNote.getInReplyTo(), equalTo(extMessageUri));
}
@Test
public void signingSpec() throws IOException {