aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-24 17:17:19 +0300
committerGravatar Vitaly Takmazov2018-10-24 17:17:19 +0300
commit4b6e60929bcaf830bba3423d66bb1f325e73fcb6 (patch)
tree99f121e618754919992199ec5024b359811447c7 /juick-server/src/test/java/com
parent0886b0290dd35b01776856db40e960863f200c68 (diff)
AcitvityPub: fix Mention rendering
Diffstat (limited to 'juick-server/src/test/java/com')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java22
1 files changed, 16 insertions, 6 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 8884beef..e9f42ee3 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
@@ -1720,15 +1720,25 @@ public class ServerTests {
Note create2 = jsonMapper.readValue(noteStr, Note.class);
}
@Test
- @Transactional
public void activitySerialization() throws Exception {
+ Message msgNoTags = commandsManager.processCommand(ugnich, "people", emptyUri).getNewMessage().get();
+ String json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(msgNoTags)));
Message msg = commandsManager.processCommand(ugnich, "*shit happens", emptyUri).getNewMessage().get();
Note note = activityPubManager.makeNote(msg);
- String json = jsonMapper.writeValueAsString(Context.build(note));
- Message reply = commandsManager.processCommand(freefd, String.format("#%d HI", msg.getMid()), emptyUri).getNewMessage().get();
- json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(reply)));
- Message msgNoTags = commandsManager.processCommand(ugnich, "people", emptyUri).getNewMessage().get();
- json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(msgNoTags)));
+ json = jsonMapper.writeValueAsString(Context.build(note));
+ Note replyNote = new Note();
+ replyNote.setId("http://localhost:8080/n/2-1");
+ replyNote.setInReplyTo(activityPubManager.messageUri(msg));
+ replyNote.setAttributedTo("http://localhost:8080/u/freefd");
+ replyNote.setTo(Collections.singletonList(activityPubManager.personUri(ugnich)));
+ replyNote.setContent("HI");
+ Create create = new Create();
+ create.setActor("http://localhost:8080/u/freefd");
+ create.setObject(replyNote);
+ signatureManager.post((Person) signatureManager.getContext(URI.create("http://localhost:8080/u/freefd")).get(),
+ (Person) signatureManager.getContext(URI.create("http://localhost:8080/u/ugnich")).get(), create);
+ Message replyToExt = commandsManager.processCommand(ugnich, String.format("#%d/1 PSSH YOBA ETO TI", msg.getMid()), emptyUri).getNewMessage().get();
+ json = jsonMapper.writeValueAsString(Context.build(activityPubManager.makeNote(messagesService.getReply(replyToExt.getMid(), replyToExt.getRid()))));
}
@Test
public void signingSpec() throws IOException {