" \"subject\": \"subject\"," + " \"keywords\": {\"$Answered\": true, \"$Deleted\": true}," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"isDraft\": true," + " \"keywords\": {\"$Answered\": true}," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
private void bartSendMessageToHomer() { String messageCreationId = "creationId"; String outboxId = getOutboxId(bartAccessToken); String bigEnoughBody = Strings.repeat("123456789\n", 12 * 100); String requestBody = "[" +
" {" + " \"update\": { \"" + messageId + "\" : {" + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
private String bartSendMessageToHomer() { String messageCreationId = "creationId"; String outboxId = getOutboxId(bartAccessToken); String requestBody = "[" + " [" +
private void sendAWrongInitialMessage() { String messageCreationId = "creationId"; String outboxId = getOutboxId(bartAccessToken); String requestBody = "[" + " [" + " \"setMessages\"," + " {" + " \"create\": { \"" + messageCreationId + "\" : {" + " \"from\": { \"name\": \"Bob\", \"email\": \"" + BART + "\"}," + " \"to\": [{ \"name\": \"User\", \"email\": \"" + HOMER + "\"}]," + " \"subject\": \"Message with an attachment\"," + " \"textBody\": \"Test body, plain text version\"," + " \"htmlBody\": \"Test <b>body</b>, HTML version\"," + " \"mailboxIds\": [\"" + outboxId + "\"] " + " }}" + " }," + " \"#0\"" + " ]" + "]"; with() .header("Authorization", bartAccessToken.serialize()) .body(requestBody) .post("/jmap") .then() .extract() .body() .path(ARGUMENTS + ".created." + messageCreationId + ".id"); calmlyAwait.until(() -> !listMessageIdsForAccount(homerAccessToken).isEmpty()); }
" \"subject\": \"subject\"," + " \"keywords\": {\"$Draft\": true}," + " \"mailboxIds\": [\"" + getDraftId(accessToken) + "\", \"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," + " \"subject\": null," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"to\": [{ \"name\": \"BOB\", \"email\": \"someone@example.com\"}]," + " \"subject\": \"\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"" + messageSubject + "\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"cc\": [{ \"name\": \"ALICE\"}]," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"subject\"," + " \"keywords\": {\"$Answered\": true, \"$Unknown\": true}," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
@Test public void setMessagesShouldVerifyHeaderOfMessageInSent() throws Exception { String toUsername = "username1@" + DOMAIN; String password = "password"; dataProbe.addUser(toUsername, password); mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, toUsername, DefaultMailboxes.INBOX); String messageCreationId = "creationId1337"; String fromAddress = USERNAME; String requestBody = "[" + " [" + " \"setMessages\"," + " {" + " \"create\": { \"" + messageCreationId + "\" : {" + " \"from\": { \"name\": \"Me\", \"email\": \"" + fromAddress + "\"}," + " \"to\": [{ \"name\": \"BOB\", \"email\": \"" + toUsername + "\"}]," + " \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," + " \"#0\"" + " ]" + "]"; with() .header("Authorization", accessToken.serialize()) .body(requestBody) .post("/jmap"); String sentMailboxId = getMailboxId(accessToken, Role.SENT); calmlyAwait.atMost(60, TimeUnit.SECONDS).until(() -> messageInMailboxHasHeaders(sentMailboxId, buildExpectedHeaders())); }
" \"subject\": \"Thank you for joining example.com!\"," + " \"textBody\": \"Hello someone, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +
" \"subject\": \"Thank you for joining example.com!\"," + " \"htmlBody\": \"Hello <b>someone</b>, and thank you for joining example.com!\"," + " \"mailboxIds\": [\"" + getOutboxId(accessToken) + "\"]" + " }}" + " }," +