aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-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 c11dfb464..bcdb4af36 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();