You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/11/18 02:50:39 UTC
[james-project] 05/44: JAMES-2949 Remove some implicit calls to
Username::toString
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 ff4d3e984cb403786d45923ba5c24070cc684387
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 14 16:53:13 2019 +0700
JAMES-2949 Remove some implicit calls to Username::toString
---
.../apache/james/jmap/VacationIntegrationTest.java | 6 +-
.../jmap/draft/methods/integration/FilterTest.java | 162 ++++++++++-----------
.../integration/ForwardIntegrationTest.java | 40 ++---
.../integration/GetMailboxesMethodTest.java | 4 +-
.../integration/GetMessageListMethodTest.java | 2 +-
.../integration/GetVacationResponseTest.java | 8 +-
.../methods/integration/QuotaMailingTest.java | 12 +-
.../methods/integration/SendMDNMethodTest.java | 17 ++-
.../methods/integration/SetMessagesMethodTest.java | 4 +-
.../ReindexingWithEventDeadLettersTest.java | 6 +-
.../EventDeadLettersIntegrationTest.java | 2 +-
11 files changed, 132 insertions(+), 131 deletions(-)
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
index 0cd225c..9798a79 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/VacationIntegrationTest.java
@@ -44,13 +44,13 @@ import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.api.vacation.AccountId;
import org.apache.james.jmap.api.vacation.VacationPatch;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.mailbox.DefaultMailboxes;
import org.apache.james.mailbox.model.MailboxConstants;
import org.apache.james.mailbox.probe.MailboxProbe;
import org.apache.james.modules.MailboxProbeImpl;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -328,8 +328,8 @@ public abstract class VacationIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + mailId + "\" : {" +
- " \"from\": { \"email\": \"" + USER_2 + "\"}," +
- " \"to\": [{ \"name\": \"Benwa\", \"email\": \"" + USER_1 + "\"}]," +
+ " \"from\": { \"email\": \"" + USER_2.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Benwa\", \"email\": \"" + USER_1.asString() + "\"}]," +
" \"subject\": \"Thank you for joining example.com!\"," +
" \"textBody\": \"" + ORIGINAL_MESSAGE_TEXT_BODY + "\"," +
" \"mailboxIds\": [\"" + outboxId + "\"]" +
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
index bdfe22d..bcdee6a 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/FilterTest.java
@@ -48,12 +48,12 @@ import org.apache.james.GuiceJamesServer;
import org.apache.james.jmap.JmapCommonRequests;
import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.mailbox.model.MailboxId;
import org.apache.james.mailbox.model.MailboxPath;
import org.apache.james.modules.MailboxProbeImpl;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -710,7 +710,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + BOB + "\"" +
+ " \"value\": \"" + BOB.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -731,8 +731,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -763,7 +763,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"to\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -784,8 +784,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -818,7 +818,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"cc\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -839,9 +839,9 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
- " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
+ " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -874,7 +874,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"recipient\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -895,9 +895,9 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
- " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
+ " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -930,7 +930,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"recipient\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -951,9 +951,9 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + CEDRIC + "\"}]," +
- " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
+ " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1007,8 +1007,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"matchme\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1042,7 +1042,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1063,8 +1063,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1097,7 +1097,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"to\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1118,8 +1118,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1152,7 +1152,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"cc\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1173,9 +1173,9 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
- " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
+ " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1208,7 +1208,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"recipient\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + CEDRIC + "\"" +
+ " \"value\": \"" + CEDRIC.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1229,9 +1229,9 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
- " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
+ " \"cc\": [{ \"name\": \"Cedric\", \"email\": \"" + BOB.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1285,8 +1285,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"nomatch\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1341,8 +1341,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"},{ \"name\": \"Cedric\", \"email\": \"" + CEDRIC.asString() + "\"}]," +
" \"subject\": \"DIFFERENT CASE VALUE\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1396,8 +1396,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1451,8 +1451,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1506,8 +1506,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1540,7 +1540,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"exactly-equals\"," +
- " \"value\": \"" + BOB + "\"" +
+ " \"value\": \"" + BOB.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1561,8 +1561,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1595,7 +1595,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"exactly-equals\"," +
- " \"value\": \"Bob <" + BOB + ">\"" +
+ " \"value\": \"Bob <" + BOB.asString() + ">\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1616,8 +1616,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1672,8 +1672,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1727,8 +1727,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1782,8 +1782,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1837,8 +1837,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1892,8 +1892,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1926,7 +1926,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"not-exactly-equals\"," +
- " \"value\": \"" + BOB + "\"" +
+ " \"value\": \"" + BOB.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -1947,8 +1947,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -1981,7 +1981,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"not-exactly-equals\"," +
- " \"value\": \"Bob <" + BOB + ">\"" +
+ " \"value\": \"Bob <" + BOB.asString() + ">\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -2002,8 +2002,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -2057,8 +2057,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -2091,7 +2091,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + BOB + "\"" +
+ " \"value\": \"" + BOB.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -2105,7 +2105,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"to\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + ALICE + "\"" +
+ " \"value\": \"" + ALICE.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -2126,8 +2126,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -2172,7 +2172,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"to\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + ALICE + "\"" +
+ " \"value\": \"" + ALICE.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -2193,8 +2193,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -2225,7 +2225,7 @@ public abstract class FilterTest {
" \"condition\": {" +
" \"field\": \"from\"," +
" \"comparator\": \"contains\"," +
- " \"value\": \"" + BOB + "\"" +
+ " \"value\": \"" + BOB.asString() + "\"" +
" }," +
" \"action\": {" +
" \"appendIn\": {" +
@@ -2246,8 +2246,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
@@ -2300,8 +2300,8 @@ public abstract class FilterTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + BOB.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"mailboxIds\": [\"" + getOutboxId(bobAccessToken) + "\"]" +
" }}" +
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/ForwardIntegrationTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/ForwardIntegrationTest.java
index 9f91387..4ddf25e 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/ForwardIntegrationTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/ForwardIntegrationTest.java
@@ -45,9 +45,9 @@ import java.util.concurrent.TimeUnit;
import org.apache.james.GuiceJamesServer;
import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.utils.SMTPMessageSender;
import org.apache.james.utils.WebAdminGuiceProbe;
import org.apache.james.webadmin.WebAdminUtils;
@@ -97,7 +97,7 @@ public abstract class ForwardIntegrationTest {
@Category(BasicFeature.class)
@Test
public void messageShouldBeForwardedWhenDefinedInRESTAPI() {
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, BOB));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), BOB.asString()));
AccessToken cedricAccessToken = authenticateJamesUser(baseUri(jmapServer), CEDRIC, CEDRIC_PASSWORD);
String messageCreationId = "creationId1337";
@@ -106,8 +106,8 @@ public abstract class ForwardIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"isUnread\": true," +
" \"isFlagged\": true," +
@@ -144,8 +144,8 @@ public abstract class ForwardIntegrationTest {
@Test
public void messageShouldBeForwardedWhenBaseRecipientWhenInDestination() {
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, BOB));
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, ALICE));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), BOB.asString()));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), ALICE.asString()));
AccessToken cedricAccessToken = authenticateJamesUser(baseUri(jmapServer), CEDRIC, CEDRIC_PASSWORD);
AccessToken aliceAccessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
@@ -155,8 +155,8 @@ public abstract class ForwardIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"isUnread\": true," +
" \"isFlagged\": true," +
@@ -204,8 +204,8 @@ public abstract class ForwardIntegrationTest {
@Test
public void recursiveForwardShouldWork() {
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, CEDRIC));
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", CEDRIC, BOB));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), CEDRIC.asString()));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", CEDRIC.asString(), BOB.asString()));
AccessToken cedricAccessToken = authenticateJamesUser(baseUri(jmapServer), CEDRIC, CEDRIC_PASSWORD);
String messageCreationId = "creationId1337";
@@ -214,8 +214,8 @@ public abstract class ForwardIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"isUnread\": true," +
" \"isFlagged\": true," +
@@ -252,9 +252,9 @@ public abstract class ForwardIntegrationTest {
@Test
public void recursiveWithRecipientCopyForwardShouldWork() {
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, ALICE));
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, BOB));
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", BOB, CEDRIC));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), ALICE.asString()));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), BOB.asString()));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", BOB.asString(), CEDRIC.asString()));
AccessToken cedricAccessToken = authenticateJamesUser(baseUri(jmapServer), CEDRIC, CEDRIC_PASSWORD);
AccessToken aliceAccessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
@@ -264,8 +264,8 @@ public abstract class ForwardIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"isUnread\": true," +
" \"isFlagged\": true," +
@@ -301,7 +301,7 @@ public abstract class ForwardIntegrationTest {
@Test
public void baseRecipientShouldNotReceiveEmailOnDefaultForward() {
- webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE, BOB));
+ webAdminApi.put(String.format("/address/forwards/%s/targets/%s", ALICE.asString(), BOB.asString()));
AccessToken cedricAccessToken = authenticateJamesUser(baseUri(jmapServer), CEDRIC, CEDRIC_PASSWORD);
AccessToken aliceAccessToken = authenticateJamesUser(baseUri(jmapServer), ALICE, ALICE_PASSWORD);
@@ -311,8 +311,8 @@ public abstract class ForwardIntegrationTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC + "\"}," +
- " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE + "\"}]," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + CEDRIC.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"Alice\", \"email\": \"" + ALICE.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"isUnread\": true," +
" \"isFlagged\": true," +
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
index daa5fe1..ac18edf 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
@@ -59,6 +59,7 @@ import org.apache.james.core.quota.QuotaCount;
import org.apache.james.core.quota.QuotaSize;
import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.jmap.draft.model.mailbox.MailboxNamespace;
import org.apache.james.mailbox.DefaultMailboxes;
import org.apache.james.mailbox.MessageManager.AppendCommand;
@@ -77,7 +78,6 @@ import org.apache.james.modules.QuotaProbesImpl;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.AllMatching;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -701,7 +701,7 @@ public abstract class GetMailboxesMethodTest {
.body(NAME, equalTo("mailboxes"))
.body(ARGUMENTS + ".list", hasSize(1))
.body(FIRST_MAILBOX + ".namespace.type", equalTo(MailboxNamespace.Type.Delegated.toString()))
- .body(FIRST_MAILBOX + ".namespace.owner", equalTo(BOB));
+ .body(FIRST_MAILBOX + ".namespace.owner", equalTo(BOB.asString()));
}
@Test
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
index cf3400e..199c156 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMessageListMethodTest.java
@@ -237,7 +237,7 @@ public abstract class GetMessageListMethodTest {
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
" \"from\": { \"name\": \"" + fromName + "\", \"email\": \"" + fromAddress + "\"}," +
- " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB + "\"}]," +
+ " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB.asString() + "\"}]," +
" \"subject\": \"Thank you for joining example.com!\"," +
" \"textBody\": \"Hello someone, and thank you for joining example.com!\"," +
" \"mailboxIds\": [\"" + getOutboxId(aliceAccessToken) + "\"]" +
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
index 13ac1bc..9e7c993 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetVacationResponseTest.java
@@ -41,10 +41,10 @@ import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.api.vacation.AccountId;
import org.apache.james.jmap.api.vacation.VacationPatch;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.probe.DataProbe;
import org.apache.james.util.date.ZonedDateTimeProvider;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -107,7 +107,7 @@ public abstract class GetVacationResponseTest {
.then()
.statusCode(200)
.body(NAME, equalTo("vacationResponse"))
- .body(ARGUMENTS + ".accountId", equalTo(ALICE))
+ .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
.body(ARGUMENTS + ".list", hasSize(1))
.body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
.body(ARGUMENTS + ".list[0].fromDate", nullValue())
@@ -143,7 +143,7 @@ public abstract class GetVacationResponseTest {
.then()
.statusCode(200)
.body(NAME, equalTo("vacationResponse"))
- .body(ARGUMENTS + ".accountId", equalTo(ALICE))
+ .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
.body(ARGUMENTS + ".list", hasSize(1))
.body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
.body(ARGUMENTS + ".list[0].fromDate", equalTo("2014-09-30T14:10:00Z"))
@@ -176,7 +176,7 @@ public abstract class GetVacationResponseTest {
.then()
.statusCode(200)
.body(NAME, equalTo("vacationResponse"))
- .body(ARGUMENTS + ".accountId", equalTo(ALICE))
+ .body(ARGUMENTS + ".accountId", equalTo(ALICE.asString()))
.body(ARGUMENTS + ".list", hasSize(1))
.body(ARGUMENTS + ".list[0].id", equalTo("singleton"))
.body(ARGUMENTS + ".list[0].fromDate", equalTo("2014-09-30T14:10:00+02:00"))
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
index e148f78..2cd2734 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/QuotaMailingTest.java
@@ -41,6 +41,7 @@ import org.apache.james.core.Username;
import org.apache.james.core.quota.QuotaSize;
import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.mailbox.DefaultMailboxes;
import org.apache.james.mailbox.model.MailboxConstants;
import org.apache.james.mailbox.model.SerializableQuotaValue;
@@ -49,7 +50,6 @@ import org.apache.james.modules.MailboxProbeImpl;
import org.apache.james.modules.QuotaProbesImpl;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.awaitility.Duration;
import org.awaitility.core.ConditionFactory;
import org.junit.After;
@@ -104,7 +104,7 @@ public abstract class QuotaMailingTest {
@Test
public void shouldSendANoticeWhenThresholdExceeded() throws Exception {
jmapServer.getProbe(QuotaProbesImpl.class)
- .setMaxStorage(MailboxConstants.USER_NAMESPACE + "&" + HOMER,
+ .setMaxStorage(MailboxConstants.USER_NAMESPACE + "&" + HOMER.asString(),
new SerializableQuotaValue<>(QuotaSize.size(100 * 1000)));
bartSendMessageToHomer();
@@ -130,7 +130,7 @@ public abstract class QuotaMailingTest {
@Test
public void configurationShouldBeWellLoaded() throws Exception {
jmapServer.getProbe(QuotaProbesImpl.class)
- .setMaxStorage(MailboxConstants.USER_NAMESPACE + "&" + HOMER,
+ .setMaxStorage(MailboxConstants.USER_NAMESPACE + "&" + HOMER.asString(),
new SerializableQuotaValue<>(QuotaSize.size(100 * 1000)));
bartSendMessageToHomer();
@@ -167,9 +167,9 @@ public abstract class QuotaMailingTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"headers\":{\"Disposition-Notification-To\":\"" + BART + "\"}," +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART + "\"}," +
- " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER + "\"}]," +
+ " \"headers\":{\"Disposition-Notification-To\":\"" + BART.asString() + "\"}," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
" \"subject\": \"Message without an attachment\"," +
" \"textBody\": \"" + bigEnoughBody + "\"," +
" \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
index d1c4e61..35f176b 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SendMDNMethodTest.java
@@ -50,6 +50,7 @@ import org.apache.james.core.quota.QuotaSize;
import org.apache.james.jmap.MessageAppender;
import org.apache.james.jmap.api.access.AccessToken;
import org.apache.james.jmap.categories.BasicFeature;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.mailbox.DefaultMailboxes;
import org.apache.james.mailbox.exception.MailboxException;
import org.apache.james.mailbox.model.MailboxConstants;
@@ -61,12 +62,12 @@ import org.apache.james.modules.MailboxProbeImpl;
import org.apache.james.modules.QuotaProbesImpl;
import org.apache.james.probe.DataProbe;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.google.common.collect.Iterables;
+
import io.restassured.RestAssured;
import io.restassured.parsing.Parser;
@@ -109,9 +110,9 @@ public abstract class SendMDNMethodTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"headers\":{\"Disposition-Notification-To\":\"" + BART + "\"}," +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART + "\"}," +
- " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER + "\"}]," +
+ " \"headers\":{\"Disposition-Notification-To\":\"" + BART.asString() + "\"}," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
" \"subject\": \"Message with an attachment\"," +
" \"textBody\": \"Test body, plain text version\"," +
" \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
@@ -143,8 +144,8 @@ public abstract class SendMDNMethodTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART + "\"}," +
- " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER + "\"}]," +
+ " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART.asString() + "\"}," +
+ " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER.asString() + "\"}]," +
" \"subject\": \"Message with an attachment\"," +
" \"textBody\": \"Test body, plain text version\"," +
" \"htmlBody\": \"Test <b>body</b>, HTML version\"," +
@@ -309,8 +310,8 @@ public abstract class SendMDNMethodTest {
.post("/jmap")
.then()
.statusCode(200)
- .body(firstMessage + ".from.email", is(HOMER))
- .body(firstMessage + ".to.email", contains(BART))
+ .body(firstMessage + ".from.email", is(HOMER.asString()))
+ .body(firstMessage + ".to.email", contains(BART.asString()))
.body(firstMessage + ".hasAttachment", is(true))
.body(firstMessage + ".textBody", is("Read confirmation"))
.body(firstMessage + ".subject", is("subject"))
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodTest.java
index 03a9868..f9eeea2 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SetMessagesMethodTest.java
@@ -2116,7 +2116,7 @@ public abstract class SetMessagesMethodTest {
" {" +
" \"create\": { \"" + draftCreationId + "\" : {" +
" \"from\": { \"name\": \"Me\", \"email\": \"" + fromAddress + "\"}," +
- " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB + "\"}]," +
+ " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"keywords\": {\"$Draft\": true}," +
" \"mailboxIds\": [\"" + getDraftId(accessToken) + "\"]" +
@@ -2168,7 +2168,7 @@ public abstract class SetMessagesMethodTest {
" {" +
" \"create\": { \"" + draftCreationId + "\" : {" +
" \"from\": { \"name\": \"Me\", \"email\": \"" + fromAddress + "\"}," +
- " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB + "\"}]," +
+ " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + BOB.asString() + "\"}]," +
" \"subject\": \"subject\"," +
" \"keywords\": {\"$Draft\": true}," +
" \"mailboxIds\": [\"" + getDraftId(accessToken) + "\"]" +
diff --git a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java
index aded2dc..c7ebe8a 100644
--- a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java
+++ b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java
@@ -39,14 +39,14 @@ import org.apache.james.DockerElasticSearchExtension;
import org.apache.james.GuiceJamesServer;
import org.apache.james.JamesServerBuilder;
import org.apache.james.JamesServerExtension;
-import org.apache.james.jmap.draft.JmapJamesServerContract;
import org.apache.james.jmap.api.access.AccessToken;
+import org.apache.james.jmap.draft.JmapGuiceProbe;
+import org.apache.james.jmap.draft.JmapJamesServerContract;
import org.apache.james.modules.AwsS3BlobStoreExtension;
import org.apache.james.modules.RabbitMQExtension;
import org.apache.james.modules.TestJMAPServerModule;
import org.apache.james.modules.objectstorage.PayloadCodecFactory;
import org.apache.james.utils.DataProbeImpl;
-import org.apache.james.jmap.draft.JmapGuiceProbe;
import org.apache.james.utils.WebAdminGuiceProbe;
import org.apache.james.webadmin.WebAdminConfiguration;
import org.apache.james.webadmin.WebAdminUtils;
@@ -158,7 +158,7 @@ class ReindexingWithEventDeadLettersTest {
" \"setMessages\"," +
" {" +
" \"create\": { \"" + messageCreationId + "\" : {" +
- " \"from\": { \"name\": \"Me\", \"email\": \"" + ALICE + "\"}," +
+ " \"from\": { \"name\": \"Me\", \"email\": \"" + ALICE.asString() + "\"}," +
" \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," +
" \"subject\": \"subject\"," +
" \"keywords\": {\"$Draft\": true}," +
diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
index b9760e6..95fdd91 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
@@ -258,7 +258,7 @@ public class EventDeadLettersIntegrationTest {
.body("MailboxAdded.mailboxId", is(mailboxId.serialize()))
.body("MailboxAdded.user", is(BOB))
.body("MailboxAdded.mailboxPath.namespace", is(BOB_INBOX_PATH.getNamespace()))
- .body("MailboxAdded.mailboxPath.user", is(BOB_INBOX_PATH.getUser()))
+ .body("MailboxAdded.mailboxPath.user", is(BOB_INBOX_PATH.getUser().asString()))
.body("MailboxAdded.mailboxPath.name", is(BOB_INBOX_PATH.getName()));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org