### Question:
MailboxApiController extends AbstractApiController { public Result deleteMailbox(@PathParam("mailboxAddress") @Email final String mailboxAddress, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(userId, mailboxAddress, context, mailbox -> { mailbox.delete(); return ApiResults.noContent(); }); }  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);  }### Answer:
@Test public void deleteMailbox() throws Exception { final MBox mailbox = TestDataUtils.createMailbox(user); Assert.assertNotNull(MBox.getById(mailbox.getId())); final HttpResponse response = apiClient.deleteMailbox(mailbox.getFullAddress()); RestApiTestUtils.validateStatusCode(response, 204); Assert.assertNull(MBox.getById(mailbox.getId())); }
@Test public void deleteMailbox_invalidMailboxAddress() throws Exception { final HttpResponse response = apiClient.deleteMailbox(invalidAddress); RestApiTestUtils.validateStatusCode(response, 400); RestApiTestUtils.validateErrors(response, "mailboxAddress"); }
@Test public void deleteMailbox_unknownMailbox() throws Exception { final HttpResponse response = apiClient.deleteMailbox(unknownAddress); RestApiTestUtils.validateStatusCode(response, 404); }