JAMES-1664 threadId and mailboxIds are not mandatory properties
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/fa18d260 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/fa18d260 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/fa18d260 Branch: refs/heads/master Commit: fa18d26067ca09c5ed3ee45edd844068ff591046 Parents: 4c8403c Author: Matthieu Baechler <matthieu.baech...@gmail.com> Authored: Wed Jan 27 17:59:27 2016 +0100 Committer: Antoine Duprat <antdup...@gmail.com> Committed: Mon Feb 1 13:21:05 2016 +0100 ---------------------------------------------------------------------- .../apache/james/jmap/methods/GetMessagesMethodTest.java | 2 -- .../org/apache/james/jmap/model/MessageProperties.java | 2 +- .../apache/james/jmap/methods/GetMessagesMethodTest.java | 10 +++++----- .../apache/james/jmap/model/MessagePropertiesTest.java | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/fa18d260/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java index 50508ca..9feda38 100644 --- a/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java +++ b/server/protocols/jmap-integration-testing/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java @@ -349,8 +349,6 @@ public abstract class GetMessagesMethodTest { assertThat(JsonPath.parse(response).<Integer>read("$.length()")).isEqualTo(1); assertThat(JsonPath.parse(response).<Integer>read(firstResponsePath + ".list.length()")).isEqualTo(1); assertThat(JsonPath.parse(response).<String>read(firstMessagePath + ".id")).isEqualTo("usern...@domain.tld|mailbox|1"); - assertThat(JsonPath.parse(response).<String>read(firstMessagePath + ".threadId")).isNotNull(); - assertThat(JsonPath.parse(response).<List<String>>read(firstMessagePath + ".mailboxIds")).isNotEmpty(); assertThat(JsonPath.parse(response).<String>read(firstMessagePath + ".subject")).isEqualTo("my test subject"); } } http://git-wip-us.apache.org/repos/asf/james-project/blob/fa18d260/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/MessageProperties.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/MessageProperties.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/MessageProperties.java index a24bf9a..4f6ba17 100644 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/MessageProperties.java +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/model/MessageProperties.java @@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet; public class MessageProperties { - public static final ImmutableSet<MessageProperty> MANDATORY_PROPERTIES = ImmutableSet.of(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds); + public static final ImmutableSet<MessageProperty> MANDATORY_PROPERTIES = ImmutableSet.of(MessageProperty.id); private final Optional<ImmutableSet<MessageProperty>> messageProperties; private final Optional<ImmutableSet<HeaderProperty>> headersProperties; http://git-wip-us.apache.org/repos/asf/james-project/blob/fa18d260/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java index 3ba78c5..ada2182 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java @@ -199,7 +199,7 @@ public class GetMessagesMethodTest { .extracting(JmapResponse::getProperties) .flatExtracting(Optional::get) .asList() - .containsOnly(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds); + .containsOnly(MessageProperty.id); } @Test @@ -224,7 +224,7 @@ public class GetMessagesMethodTest { } @Test - public void processShouldAddMantoryPropertiesWhenNotInPropertyList() throws MailboxException { + public void processShouldAddMandatoryPropertiesWhenNotInPropertyList() throws MailboxException { MessageManager inbox = mailboxManager.getMailbox(inboxPath, session); Date now = new Date(); ByteArrayInputStream message1Content = new ByteArrayInputStream("Subject: message 1 subject\r\n\r\nmy message".getBytes(Charsets.UTF_8)); @@ -235,7 +235,7 @@ public class GetMessagesMethodTest { .properties(ImmutableList.of(MessageProperty.subject.asFieldName())) .build(); - Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds, MessageProperty.subject); + Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.subject); GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory); List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList()); @@ -259,7 +259,7 @@ public class GetMessagesMethodTest { .properties(ImmutableList.of(MessageProperty.body.asFieldName())) .build(); - Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds, MessageProperty.textBody); + Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.textBody); GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory); List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList()); @@ -286,7 +286,7 @@ public class GetMessagesMethodTest { .properties(ImmutableList.of("headers.from", "headers.heADER2")) .build(); - Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds, MessageProperty.headers); + Set<MessageProperty> expected = Sets.newHashSet(MessageProperty.id, MessageProperty.headers); GetMessagesMethod<InMemoryId> testee = new GetMessagesMethod<>(mailboxSessionMapperFactory, mailboxSessionMapperFactory); List<JmapResponse> result = testee.process(request, clientId, session).collect(Collectors.toList()); http://git-wip-us.apache.org/repos/asf/james-project/blob/fa18d260/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessagePropertiesTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessagePropertiesTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessagePropertiesTest.java index f6eb239..eb9c2b3 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessagePropertiesTest.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessagePropertiesTest.java @@ -55,7 +55,7 @@ public class MessagePropertiesTest { public void toOutputPropertiesShouldReturnMandatoryPropertiesWhenEmptyRequest() { MessageProperties actual = new MessageProperties(Optional.of(ImmutableSet.of())).toOutputProperties(); assertThat(actual.getOptionalMessageProperties()) - .hasValue(ImmutableSet.of(MessageProperty.id, MessageProperty.threadId, MessageProperty.mailboxIds)); + .hasValue(ImmutableSet.of(MessageProperty.id)); } @Test --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org