diff options
author | Vitaly Takmazov | 2022-12-15 20:40:59 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-15 20:40:59 +0300 |
commit | 725f2fde72df4bdd92a2262fbb335f40e0a81a1c (patch) | |
tree | 71e1612dd27c630a4115c56838e974720a8850d8 /src/test/java/com | |
parent | b1267ab73fd601dcc1636a64d86135d72631b525 (diff) |
Extract profile URI helpers into ProfileUriBuilder
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 224743a7..796417c8 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -152,6 +152,7 @@ import com.juick.www.ad.models.Site; import com.juick.www.api.SystemActivity; import com.juick.www.api.Users; import com.juick.www.api.activity.Profile; +import com.juick.www.api.activity.helpers.ProfileUriBuilder; import com.juick.www.api.activity.model.Context; import com.juick.www.api.activity.model.activities.Announce; import com.juick.www.api.activity.model.activities.Create; @@ -289,6 +290,8 @@ public class ServerTests { @Inject private ActivityPubManager activityPubManager; @Inject + private ProfileUriBuilder profileUriBuilder; + @Inject private WebApp webApp; @Inject private RestTemplate apClient; @@ -1485,7 +1488,7 @@ public class ServerTests { Mockito.verify(activityListener, Mockito.times(1)).onApplicationEvent(updateEventCaptor.capture()); UpdateEvent updateEvent = updateEventCaptor.getValue(); assertThat(updateEvent.getUser(), is(ugnich)); - assertThat(activityPubManager.messageUri(original.getMid(), 0), is(updateEvent.getMessageUri())); + assertThat(profileUriBuilder.messageUri(original.getMid(), 0), is(updateEvent.getMessageUri())); mockMvc.perform(post("/api/update").with(httpBasic(freefdName, freefdPassword)) .param("mid", String.valueOf(original.getMid())).param("body", "PEOPLE")) .andExpect(status().is(403)); @@ -2124,9 +2127,9 @@ public class ServerTests { json = jsonMapper.writeValueAsString(Context.build(note)); Note replyNote = new Note(); replyNote.setId("http://localhost:8080/n/2-1"); - replyNote.setInReplyTo(activityPubManager.messageUri(msg)); + replyNote.setInReplyTo(profileUriBuilder.messageUri(msg)); replyNote.setAttributedTo("http://localhost:8080/u/freefd"); - replyNote.setTo(Collections.singletonList(activityPubManager.personUri(ugnich))); + replyNote.setTo(Collections.singletonList(profileUriBuilder.personUri(ugnich))); replyNote.setContent("HI"); Create create = new Create(); create.setId(replyNote.getId()); |