This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new c580251b35 [FIX] Await in EmailGetMethodContract (#2876)
c580251b35 is described below
commit c580251b35f0774e2fd4683a0c742bfab4cab673
Author: Benoit TELLIER <[email protected]>
AuthorDate: Fri Dec 5 17:52:10 2025 +0100
[FIX] Await in EmailGetMethodContract (#2876)
This is because th fast view projection might not be populated fast enough
for triggering the attachment view.
---
.../rfc8621/contract/EmailGetMethodContract.scala | 110 +++++++++++----------
1 file changed, 56 insertions(+), 54 deletions(-)
diff --git
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
index e7348e3589..85c8e7b38f 100644
---
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
+++
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailGetMethodContract.scala
@@ -5145,60 +5145,62 @@ trait EmailGetMethodContract {
.body
.asString
- assertThatJson(response)
- .whenIgnoringPaths("methodResponses[0][1].state",
"methodResponses[0][1].list[0].attachments[0].blobId",
"methodResponses[0][1].list[0].attachments[1].blobId")
- .isEqualTo(
- s"""{
- | "sessionState": "${SESSION_STATE.value}",
- | "methodResponses": [
- | [
- | "Email/get",
- | {
- | "accountId":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
- | "notFound": [],
- | "list": [{
- | "preview": "Main test
message...",
- | "to": [{
- | "name": "Alice",
- | "email":
"[email protected]"
- | }],
- | "id": "${messageId.serialize}",
- | "mailboxIds": {
- |
"${mailboxId.serialize}": true
- | },
- | "from": [{
- | "name": "Bob",
- | "email":
"[email protected]"
- | }],
- | "keywords": {
- |
- | },
- | "receivedAt":
"$${json-unit.ignore}",
- | "sentAt":
"$${json-unit.ignore}",
- | "hasAttachment": true,
- | "attachments": [{
- | "charset":
"US-ASCII",
- | "disposition":
"attachment",
- | "size": 102,
- | "name":
"yyy.txt",
- | "type":
"application/json"
- | },
- | {
- | "charset":
"US-ASCII",
- | "disposition":
"attachment",
- | "size": 102,
- | "name":
"xxx.txt",
- | "type":
"application/json"
- | }
- | ],
- | "subject": "My subject",
- | "size": 1011
- | }]
- | },
- | "c1"
- | ]
- | ]
- |}""".stripMargin)
+ Awaitility.await().atMost(Duration.ofSeconds(5))
+ .untilAsserted(() =>
+ assertThatJson(response)
+ .whenIgnoringPaths("methodResponses[0][1].state",
"methodResponses[0][1].list[0].attachments[0].blobId",
"methodResponses[0][1].list[0].attachments[1].blobId")
+ .isEqualTo(
+ s"""{
+ | "sessionState": "${SESSION_STATE.value}",
+ | "methodResponses": [
+ | [
+ | "Email/get",
+ | {
+ | "accountId":
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+ | "notFound": [],
+ | "list": [{
+ | "preview": "Main test
message...",
+ | "to": [{
+ | "name": "Alice",
+ | "email":
"[email protected]"
+ | }],
+ | "id":
"${messageId.serialize}",
+ | "mailboxIds": {
+ |
"${mailboxId.serialize}": true
+ | },
+ | "from": [{
+ | "name": "Bob",
+ | "email":
"[email protected]"
+ | }],
+ | "keywords": {
+ |
+ | },
+ | "receivedAt":
"$${json-unit.ignore}",
+ | "sentAt":
"$${json-unit.ignore}",
+ | "hasAttachment": true,
+ | "attachments": [{
+ |
"charset": "US-ASCII",
+ |
"disposition": "attachment",
+ | "size":
102,
+ | "name":
"yyy.txt",
+ | "type":
"application/json"
+ | },
+ | {
+ |
"charset": "US-ASCII",
+ |
"disposition": "attachment",
+ | "size":
102,
+ | "name":
"xxx.txt",
+ | "type":
"application/json"
+ | }
+ | ],
+ | "subject": "My subject",
+ | "size": 1011
+ | }]
+ | },
+ | "c1"
+ | ]
+ | ]
+ |}""".stripMargin))
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
