You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2020/09/08 03:43:11 UTC
[james-project] 17/19: [Refactoring] Little cleanups in JMAP
contracts
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
commit f812ddd2ca2ab7d34526dc47b49322bcded1dde7
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Mon Sep 7 16:41:48 2020 +0700
[Refactoring] Little cleanups in JMAP contracts
---
.../rfc8621/contract/BackReferenceContract.scala | 4 +-
.../rfc8621/contract/EmailGetMethodContract.scala | 94 +---------------------
.../contract/MailboxSetMethodContract.scala | 3 +-
.../VacationResponseSetMethodContract.scala | 25 +++---
4 files changed, 16 insertions(+), 110 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/BackReferenceContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/BackReferenceContract.scala
index 27317e1..449e091 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/BackReferenceContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/BackReferenceContract.scala
@@ -25,9 +25,8 @@ import org.apache.http.HttpStatus.SC_OK
import org.apache.james.GuiceJamesServer
import org.apache.james.jmap.http.UserCredential
import org.apache.james.jmap.rfc8621.contract.Fixture._
-import org.apache.james.jmap.rfc8621.contract.tags.CategoryTags
import org.apache.james.utils.DataProbeImpl
-import org.junit.jupiter.api.{BeforeEach, Tag, Test}
+import org.junit.jupiter.api.{BeforeEach, Test}
trait BackReferenceContract {
@BeforeEach
@@ -44,7 +43,6 @@ trait BackReferenceContract {
}
@Test
- @Tag(CategoryTags.BASIC_FEATURE)
def backReferenceResolvingShouldWork(): Unit = {
val response = `given`
.header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
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 1efc60f..78f3403 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
@@ -673,7 +673,7 @@ trait EmailGetMethodContract {
}
@Test
- def requestingTheSameNotFoundIdTwiceReturnsItOnce(server: GuiceJamesServer): Unit = {
+ def requestingTheSameNotFoundIdTwiceReturnsItOnce(): Unit = {
val messageId: MessageId = randomMessageId
val request =
s"""{
@@ -1725,16 +1725,6 @@ trait EmailGetMethodContract {
| {
| "partId": "2",
| "blobId": "${messageId.serialize()}_2",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "text/plain; charset=utf-8; format=flowed"
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "7bit"
- | }
- | ],
| "size": 97,
| "type": "text/plain",
| "charset": "utf-8"
@@ -1799,16 +1789,6 @@ trait EmailGetMethodContract {
| {
| "partId": "3",
| "blobId": "${messageId.serialize()}_3",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "text/plain; charset=ISO-8859-1; format=flowed"
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "8bit"
- | }
- | ],
| "size": 114,
| "type": "text/plain",
| "charset": "ISO-8859-1"
@@ -1873,16 +1853,6 @@ trait EmailGetMethodContract {
| {
| "partId": "4",
| "blobId": "${messageId.serialize()}_4",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "text/html; charset=ISO-8859-1"
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "7bit"
- | }
- | ],
| "size": 108,
| "type": "text/html",
| "charset": "ISO-8859-1"
@@ -1947,20 +1917,6 @@ trait EmailGetMethodContract {
| {
| "partId": "3",
| "blobId": "${messageId.serialize()}_3",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "text/plain; charset=UTF-8; name=\\\"text1\\\""
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "base64"
- | },
- | {
- | "name": "Content-Disposition",
- | "value": "attachment; filename=\\\"text1\\\""
- | }
- | ],
| "size": 519,
| "name": "text1",
| "type": "text/plain",
@@ -1970,20 +1926,6 @@ trait EmailGetMethodContract {
| {
| "partId": "4",
| "blobId": "${messageId.serialize()}_4",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "application/vnd.ms-publisher; name=\\\"text2\\\""
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "base64"
- | },
- | {
- | "name": "Content-Disposition",
- | "value": "attachment; filename=\\\"text2\\\""
- | }
- | ],
| "size": 694,
| "name": "text2",
| "type": "application/vnd.ms-publisher",
@@ -1993,20 +1935,6 @@ trait EmailGetMethodContract {
| {
| "partId": "5",
| "blobId": "${messageId.serialize()}_5",
- | "headers": [
- | {
- | "name": "Content-Type",
- | "value": "text/plain; charset=UTF-8; name=\\\"text3\\\""
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "base64"
- | },
- | {
- | "name": "Content-Disposition",
- | "value": "attachment; filename=\\\"text3\\\""
- | }
- | ],
| "size": 713,
| "name": "text3",
| "type": "text/plain",
@@ -2073,30 +2001,12 @@ trait EmailGetMethodContract {
| {
| "partId": "5",
| "blobId": "${messageId.serialize()}_5",
- | "headers": [
- | {
- | "name": "Content-ID",
- | "value": "<14...@linagora.com>"
- | },
- | {
- | "name": "Content-Type",
- | "value": "text/plain; charset=\\\"iso-8859-1\\\"; name=\\\"avertissement.txt\\\""
- | },
- | {
- | "name": "Content-Disposition",
- | "value": "inline; filename=\\\"avertissement.txt\\\""
- | },
- | {
- | "name": "Content-Transfer-Encoding",
- | "value": "binary"
- | }
- | ],
| "size": 249,
| "name": "avertissement.txt",
| "type": "text/plain",
| "charset": "iso-8859-1",
| "disposition": "inline",
- | "cid": "<14...@linagora.com>"
+ | "cid": "14672787885774e5c4d4cee471352039@linagora.com"
| }
| ]
| }
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/MailboxSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
index abe1b84..cbe2daa 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/MailboxSetMethodContract.scala
@@ -2628,7 +2628,7 @@ trait MailboxSetMethodContract {
}
@Test
- def creationIdReferencesShouldFailWhenNone(server: GuiceJamesServer): Unit = {
+ def creationIdReferencesShouldFailWhenNone(): Unit = {
val request =
s"""
|{
@@ -3597,7 +3597,6 @@ trait MailboxSetMethodContract {
}
@Test
- @Tag(CategoryTags.BASIC_FEATURE)
def deleteShouldSucceedWhenOnDestroyRemoveEmails(server: GuiceJamesServer): Unit = {
val mailboxId: MailboxId = server.getProbe(classOf[MailboxProbeImpl]).createMailbox(MailboxPath.forUser(BOB, "mailbox"))
val message: Message = Message.Builder
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/VacationResponseSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseSetMethodContract.scala
index c2adc5f..d2fc11e 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/VacationResponseSetMethodContract.scala
@@ -46,7 +46,7 @@ trait VacationResponseSetMethodContract {
@Test
@Tag(CategoryTags.BASIC_FEATURE)
- def updateShouldSucceed(server: GuiceJamesServer): Unit = {
+ def updateShouldSucceed(): Unit = {
val request =
s"""
|{
@@ -120,7 +120,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldNoopWhenEmptyPatchObject(server: GuiceJamesServer): Unit = {
+ def updateShouldNoopWhenEmptyPatchObject(): Unit = {
val request1 =
s"""
|{
@@ -220,8 +220,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- @Tag(CategoryTags.BASIC_FEATURE)
- def partialUpdateShouldSucceed(server: GuiceJamesServer): Unit = {
+ def partialUpdateShouldSucceed(): Unit = {
val request =
s"""
|{
@@ -270,7 +269,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def partialUpdateShouldNotAffectOtherFields(server: GuiceJamesServer): Unit = {
+ def partialUpdateShouldNotAffectOtherFields(): Unit = {
val request1 =
s"""
|{
@@ -373,7 +372,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldFailWhenInvalidKey(server: GuiceJamesServer): Unit = {
+ def updateShouldFailWhenInvalidKey(): Unit = {
val request =
s"""
|{
@@ -425,7 +424,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldFailWhenIdIsPresent(server: GuiceJamesServer): Unit = {
+ def updateShouldFailWhenIdIsPresent(): Unit = {
val request =
s"""
|{
@@ -478,7 +477,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldFailWhenInvalidDate(server: GuiceJamesServer): Unit = {
+ def updateShouldFailWhenInvalidDate(): Unit = {
val request =
s"""
|{
@@ -530,7 +529,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldFailWhenFromDateIsMoreRecentThanToDate(server: GuiceJamesServer): Unit = {
+ def updateShouldFailWhenFromDateIsMoreRecentThanToDate(): Unit = {
val request =
s"""
|{
@@ -583,7 +582,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldNoopWhenEmptyMap(server: GuiceJamesServer): Unit = {
+ def updateShouldNoopWhenEmptyMap(): Unit = {
val request =
s"""
|{
@@ -626,7 +625,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def updateShouldFailWhenMultiplePatchObjects(server: GuiceJamesServer): Unit = {
+ def updateShouldFailWhenMultiplePatchObjects(): Unit = {
val request =
s"""
|{
@@ -684,7 +683,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def createShouldFail(server: GuiceJamesServer): Unit = {
+ def createShouldFail(): Unit = {
val request =
s"""
|{
@@ -736,7 +735,7 @@ trait VacationResponseSetMethodContract {
}
@Test
- def destroyShouldFail(server: GuiceJamesServer): Unit = {
+ def destroyShouldFail(): Unit = {
val request =
s"""
|{
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org