diff options
author | Vitaly Takmazov | 2018-11-07 17:59:40 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-07 17:59:40 +0300 |
commit | 0541dc6e943f4c53c3be57dbe83e1324dbd1e068 (patch) | |
tree | 4e548f6f8d17498a4d13eac0ba799d934972bbc2 /juick-server/src/test | |
parent | 41774dd605234af5ff9a10d3ffb1d7bdbb9d9eb7 (diff) |
/.well-known/x-nodeinfo2
Diffstat (limited to 'juick-server/src/test')
-rw-r--r-- | juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 3 | ||||
-rw-r--r-- | juick-server/src/test/resources/xnodeinfo2.json | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index 4161583a..5383536a 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -40,6 +40,7 @@ import com.juick.server.api.activity.model.activities.Undo; import com.juick.server.api.activity.model.objects.Note; import com.juick.server.api.activity.model.objects.Person; import com.juick.server.api.webfinger.model.Account; +import com.juick.server.api.xnodeinfo2.model.NodeInfo; import com.juick.server.util.HttpUtils; import com.juick.server.util.ImageUtils; import com.juick.server.xmpp.helpers.XMPPStatus; @@ -1728,6 +1729,8 @@ public class ServerTests { String noteStr = IOUtils.toString(new ClassPathResource("mention.json").getURI(), StandardCharsets.UTF_8); Note create2 = jsonMapper.readValue(noteStr, Note.class); jsonMapper.readValue(IOUtils.toString(new ClassPathResource("webfinger.json").getURI(), StandardCharsets.UTF_8), Account.class); + NodeInfo info = jsonMapper.readValue(IOUtils.toString(new ClassPathResource("xnodeinfo2.json").getURI(), StandardCharsets.UTF_8), NodeInfo.class); + assertThat(info.getUsage().getUsers().getActiveHalfyear(), is(42)); } @Test public void activitySerialization() throws Exception { diff --git a/juick-server/src/test/resources/xnodeinfo2.json b/juick-server/src/test/resources/xnodeinfo2.json new file mode 100644 index 00000000..14be6394 --- /dev/null +++ b/juick-server/src/test/resources/xnodeinfo2.json @@ -0,0 +1,24 @@ +{ + "version": "1.0", + "server": { + "baseUrl": "https://example.com", + "name": "Example diaspora* server", + "software": "diaspora", + "version": "0.5.0" + }, + "protocols": ["diaspora", "zot"], + "services": { + "inbound": ["gnusocial"], + "outbound": ["facebook", "twitter"] + }, + "openRegistrations": true, + "usage": { + "users": { + "total": 123, + "activeHalfyear": 42, + "activeMonth": 23 + }, + "localPosts": 500, + "localComments": 1000 + } +}
\ No newline at end of file |