aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java3
-rw-r--r--juick-server/src/test/resources/xnodeinfo2.json24
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