@Test public void getMailbox() throws Exception { final MBox mailbox = TestDataUtils.createMailbox(user); final HttpResponse response = apiClient.getMailbox(mailbox.getFullAddress()); RestApiTestUtils.validateStatusCode(response, 200); final MailboxData mailboxData = RestApiTestUtils.getResponseBodyAs(response, MailboxData.class); RestApiTestUtils.validateMailboxData(mailboxData, mailbox); }
public Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { final MailboxData mailboxData = new MailboxData(mailbox); return ApiResults.ok().render(mailboxData); }); }
MailboxApiController extends AbstractApiController { public Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { final MailboxData mailboxData = new MailboxData(mailbox); return ApiResults.ok().render(mailboxData); }); } }
MailboxApiController extends AbstractApiController { public Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { final MailboxData mailboxData = new MailboxData(mailbox); return ApiResults.ok().render(mailboxData); }); }  }
MailboxApiController extends AbstractApiController { public Result getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { final MailboxData mailboxData = new MailboxData(mailbox); return ApiResults.ok().render(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 getMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { final MailboxData mailboxData = new MailboxData(mailbox); return ApiResults.ok().render(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);  }