diff options
author | Vitaly Takmazov | 2021-08-22 14:52:40 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-08-22 14:52:40 +0300 |
commit | f7ebc8831b032196e6695fa22647717a7bf2b55c (patch) | |
tree | bb05cc5aba7595de6f1f90fc7c2f558e28196239 /src/test | |
parent | d918967281652ead0130c5dbef663e82003d4393 (diff) |
ActivityPub: fix empty object serialization
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 |
1 files changed, 6 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 db1449f2..bdca6cd2 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -41,7 +41,6 @@ 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; import com.juick.www.api.activity.model.objects.Person; import com.juick.www.api.webfinger.model.Account; @@ -2384,4 +2383,10 @@ public class ServerTests { mockMvc.perform(get("/api/messages").header("Accept", "application/xml")).andExpect(status().isBadRequest()) .andExpect(content().string("Invalid media type")); } + @Test + public void emptyContextShouldNotSerializeType() throws Exception { + Context context = new Context("http://juick.com/u/ermine"); + String contextString = jsonMapper.writeValueAsString(context); + assertThat(contextString, is("{\"id\":\"http://juick.com/u/ermine\"}")); + } } |