chibenwa commented on a change in pull request #780:
URL: https://github.com/apache/james-project/pull/780#discussion_r763985108
##########
File path:
server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/SessionRoutesContract.scala
##########
@@ -171,4 +171,111 @@ trait SessionRoutesContract {
assertThatJson(sessionJson).isEqualTo(expected_session_object)
}
+
+ @Test
+ def
getResponseShouldReturnUrlEndpointContainJmapPrefixWhenAssignHeaderAndConfigurationProvided():
Unit = {
+ val sessionJson: String = `given`()
+ .when()
+ .header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
+ .header("X-JMAP-PREFIX", "/oidc")
+ .get("/session")
+ .`then`
+ .statusCode(SC_OK)
+ .contentType(JSON)
+ .extract()
+ .body()
+ .asString()
+
+ assertThatJson(sessionJson).isEqualTo(
+ """{
+ | "capabilities" : {
+ | "urn:ietf:params:jmap:submission": {
+ | "maxDelayedSend": 0,
+ | "submissionExtensions": []
+ | },
+ | "urn:ietf:params:jmap:core" : {
+ | "maxSizeUpload" : 20971520,
+ | "maxConcurrentUpload" : 4,
+ | "maxSizeRequest" : 10000000,
+ | "maxConcurrentRequests" : 4,
+ | "maxCallsInRequest" : 16,
+ | "maxObjectsInGet" : 500,
+ | "maxObjectsInSet" : 500,
+ | "collationAlgorithms" : [ "i;unicode-casemap" ]
+ | },
+ | "urn:ietf:params:jmap:mail" : {
+ | "maxMailboxesPerEmail" : 10000000,
+ | "maxMailboxDepth" : null,
+ | "maxSizeMailboxName" : 200,
+ | "maxSizeAttachmentsPerEmail" : 20000000,
+ | "emailQuerySortOptions" : ["receivedAt", "sentAt", "size",
"from", "to", "subject"],
+ | "mayCreateTopLevelMailbox" : true
+ | },
+ | "urn:ietf:params:jmap:websocket": {
+ | "supportsPush": true,
+ | "url": "ws://domain.com/oidc/jmap/ws"
+ | },
+ | "urn:apache:james:params:jmap:mail:quota": {},
+ | "urn:apache:james:params:jmap:mail:shares": {},
+ | "urn:ietf:params:jmap:vacationresponse":{},
+ | "urn:ietf:params:jmap:mdn":{}
+ | },
+ | "accounts" : {
+ |
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6" : {
+ | "name" : "[email protected]",
+ | "isPersonal" : true,
+ | "isReadOnly" : false,
+ | "accountCapabilities" : {
+ | "urn:ietf:params:jmap:submission": {
+ | "maxDelayedSend": 0,
+ | "submissionExtensions": []
+ | },
+ | "urn:ietf:params:jmap:websocket": {
+ | "supportsPush": true,
+ | "url": "ws://domain.com/jmap/ws"
+ | },
+ | "urn:ietf:params:jmap:core" : {
+ | "maxSizeUpload" : 20971520,
+ | "maxConcurrentUpload" : 4,
+ | "maxSizeRequest" : 10000000,
+ | "maxConcurrentRequests" : 4,
+ | "maxCallsInRequest" : 16,
+ | "maxObjectsInGet" : 500,
+ | "maxObjectsInSet" : 500,
+ | "collationAlgorithms" : [ "i;unicode-casemap" ]
+ | },
+ | "urn:ietf:params:jmap:mail" : {
+ | "maxMailboxesPerEmail" : 10000000,
+ | "maxMailboxDepth" : null,
+ | "maxSizeMailboxName" : 200,
+ | "maxSizeAttachmentsPerEmail" : 20000000,
+ | "emailQuerySortOptions" : ["receivedAt", "sentAt", "size",
"from", "to", "subject"],
+ | "mayCreateTopLevelMailbox" : true
+ | },
+ | "urn:apache:james:params:jmap:mail:quota": {},
+ | "urn:apache:james:params:jmap:mail:shares": {},
+ | "urn:ietf:params:jmap:vacationresponse":{},
+ | "urn:ietf:params:jmap:mdn":{}
+ | }
+ | }
+ | },
+ | "primaryAccounts" : {
+ | "urn:ietf:params:jmap:submission":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:ietf:params:jmap:websocket":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:ietf:params:jmap:core" :
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:ietf:params:jmap:mail" :
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:apache:james:params:jmap:mail:quota":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:apache:james:params:jmap:mail:shares":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:ietf:params:jmap:vacationresponse":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "urn:ietf:params:jmap:mdn":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6"
+ | },
+ | "username" : "[email protected]",
+ | "apiUrl" : "http://domain.com/oidc/jmap",
+ | "downloadUrl" :
"http://domain.com/oidc/download/{accountId}/{blobId}?type={type}&name={name}",
+ | "uploadUrl" : "http://domain.com/oidc/upload/{accountId}",
+ | "eventSourceUrl" :
"http://domain.com/oidc/eventSource?types={types}&closeAfter={closeafter}&ping={ping}",
Review comment:
Maybe we could find a way to only assert those URLs ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]