Use short type labels in JSON API instead of long Java-like namespaces

This commit is contained in:
Torsten Grote
2018-10-03 13:44:25 -03:00
parent ea749f2128
commit 6f54718756
7 changed files with 19 additions and 23 deletions

View File

@@ -65,7 +65,7 @@ internal class WebSocketControllerTest : ControllerTest() {
val json = """
{
"type": "event",
"name": "org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent",
"name": "PrivateMessageReceivedEvent",
"data": ${toJson(header.output(contact.id, body))}
}
"""

View File

@@ -115,10 +115,7 @@ internal class MessagingControllerImplTest : ControllerTest() {
assertEquals(contact.id.int, output["contactId"])
assertEquals(body, output["body"])
assertEquals(message.id.bytes, output["id"])
assertEquals(
"org.briarproject.briar.api.messaging.PrivateMessageHeader",
output["type"]
)
assertEquals("PrivateMessage", output["type"])
}
@Test
@@ -170,7 +167,7 @@ internal class MessagingControllerImplTest : ControllerTest() {
val json = """
{
"body": "$body",
"type": "org.briarproject.briar.api.messaging.PrivateMessageHeader",
"type": "PrivateMessage",
"timestamp": $timestamp,
"groupId": ${toJson(header.groupId.bytes)},
"contactId": ${contact.id.int},
@@ -193,7 +190,7 @@ internal class MessagingControllerImplTest : ControllerTest() {
val json = """
{
"body": null,
"type": "org.briarproject.briar.api.introduction.IntroductionRequest",
"type": "IntroductionRequest",
"timestamp": $timestamp,
"groupId": ${toJson(request.groupId.bytes)},
"contactId": ${contact.id.int},