aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-08-22 06:55:37 +0300
committerGravatar Vitaly Takmazov2021-08-22 06:55:37 +0300
commit03d42d6e6ccaee4ff9d2a0808e51e5f9f0dc18c3 (patch)
treea3a6f5ef310b2130ff6fdf541f34facecd8bf2b3 /src/test/java/com/juick/server
parent9100b5bda037fcd1b051b98585744077132320bc (diff)
ActivityPub: return Application profile for service user
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index c11dfb46..bcdb4af3 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -39,6 +39,7 @@ import com.juick.www.api.Users;
import com.juick.www.api.activity.Profile;
import com.juick.www.api.activity.model.Context;
import com.juick.www.api.activity.model.activities.*;
+import com.juick.www.api.activity.model.objects.Actor;
import com.juick.www.api.activity.model.objects.Application;
import com.juick.www.api.activity.model.objects.Image;
import com.juick.www.api.activity.model.objects.Note;
@@ -1863,7 +1864,7 @@ public class ServerTests {
String requestDate = DateFormattersHolder.getHttpDateFormatter().format(now);
mockMvc.perform(get("/api/me").header("Date", requestDate)).andExpect(status().isUnauthorized());
String testHost = "localhost";
- Person ugnichPerson = profileController.getUser("ugnich");
+ Actor ugnichPerson = profileController.getUser("ugnich");
now = Instant.now();
requestDate = DateFormattersHolder.getHttpDateFormatter().format(now);
String signatureString = signatureManager.addSignature(ugnichPerson, testHost, "GET", meUri, requestDate,
@@ -1925,6 +1926,14 @@ public class ServerTests {
}
@Test
+ public void serviceUserProfileIsApplicationProfile() throws Exception {
+ MvcResult response = mockMvc.perform(get("/u/juick")
+ .accept(Context.ACTIVITY_MEDIA_TYPE)).andReturn();
+ Actor actor = jsonMapper.readValue(response.getResponse().getContentAsString(), Actor.class);
+ assertThat(actor, is(instanceOf(Application.class)));
+ }
+
+ @Test
public void hostmeta() throws Exception {
MvcResult result = mockMvc.perform(get("/.well-known/host-meta")).andExpect(status().isOk()).andReturn();
String xrd = result.getResponse().getContentAsString();