@Test public void updateMailbox() throws Exception { MBox mailbox = TestDataUtils.createMailbox(user); final String mailboxAddress = "updated@xcmailr.test"; final long expirationDate = System.currentTimeMillis(); final boolean forwardEnabled = true; final HttpResponse response = apiClient.updateMailbox(mailbox.getFullAddress(), mailboxAddress, expirationDate, forwardEnabled); RestApiTestUtils.validateStatusCode(response, 200); final MailboxData mailboxData = RestApiTestUtils.getResponseBodyAs(response, MailboxData.class); RestApiTestUtils.validateMailboxData(mailboxData, mailboxAddress, expirationDate, forwardEnabled); mailbox = MBox.getById(mailbox.getId()); RestApiTestUtils.validateMailbox(mailbox, mailboxData); }
public Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @JSR303Validation final MailboxData mailboxData, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> doUpdateMailbox(mailbox, mailboxData)); }
MailboxApiController extends AbstractApiController { public Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @JSR303Validation final MailboxData mailboxData, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> doUpdateMailbox(mailbox, mailboxData)); } }
MailboxApiController extends AbstractApiController { public Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @JSR303Validation final MailboxData mailboxData, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> doUpdateMailbox(mailbox, mailboxData)); }  }
MailboxApiController extends AbstractApiController { public Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @JSR303Validation final MailboxData mailboxData, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> doUpdateMailbox(mailbox, mailboxData)); }  Result listMailboxes(@Attribute("userId") @DbId final Long userId, final Context context); Result createMailbox(@JSR303Validation final MailboxData mailboxData, @Attribute("user") final User user,
                                final Context context); Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                             @Attribute("userId") @DbId final Long userId, final Context context); Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                                @JSR303Validation final MailboxData mailboxData,
                                @Attribute("userId") @DbId final Long userId, final Context context); Result deleteMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                                @Attribute("userId") @DbId final Long userId, final Context context); }
MailboxApiController extends AbstractApiController { public Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @JSR303Validation final MailboxData mailboxData, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> doUpdateMailbox(mailbox, mailboxData)); }  Result listMailboxes(@Attribute("userId") @DbId final Long userId, final Context context); Result createMailbox(@JSR303Validation final MailboxData mailboxData, @Attribute("user") final User user,
                                final Context context); Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                             @Attribute("userId") @DbId final Long userId, final Context context); Result updateMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                                @JSR303Validation final MailboxData mailboxData,
                                @Attribute("userId") @DbId final Long userId, final Context context); Result deleteMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress,
                                @Attribute("userId") @DbId final Long userId, final Context context);  }