From 725f2fde72df4bdd92a2262fbb335f40e0a81a1c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 15 Dec 2022 20:40:59 +0300 Subject: Extract profile URI helpers into ProfileUriBuilder --- src/test/java/com/juick/server/tests/ServerTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test/java/com/juick/server/tests') 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()); -- cgit v1.2.3