### Question:
MailApiController extends AbstractApiController { public Result getMail(@PathParam("mailId") @DbId final Long mailId, @Attribute("userId") @DbId final Long userId, final Context context) { return performAction(mailId, userId, context, mail -> { try { final MailData mailData = new MailData(mail); return ApiResults.ok().render(mailData); } catch (final Exception e) { log.error("Failed to parse MIME message", e); return ApiResults.internalServerError(); } }); }  Result listMails(@Param("mailboxAddress") @Email final String mailboxAddress,
                            @Attribute("userId") @DbId final Long userId, final Context context); Result getMail(@PathParam("mailId") @DbId final Long mailId, @Attribute("userId") @DbId final Long userId,
                          final Context context); Result getMailAttachment(@PathParam("mailId") @DbId final Long mailId,
                                    @PathParam("attachmentName") @NotBlank final String attachmentName,
                                    @Attribute("userId") @DbId final Long userId, final Context context); Result deleteMail(@PathParam("mailId") @DbId final Long mailId, @Attribute("userId") @DbId final Long userId,
                             final Context context);  }### Answer:
@Test public void getMail() throws Exception { final HttpResponse response = apiClient.getMail(mailId); RestApiTestUtils.validateStatusCode(response, 200); }
@Test public void getMail_someoneElsesMail() throws Exception { final HttpResponse response = apiClient.getMail(otherUsersMailId); RestApiTestUtils.validateStatusCode(response, 403); RestApiTestUtils.validateErrors(response, "mailId"); }
@Test public void getMail_invalidId() throws Exception { final HttpResponse response = apiClient.getMail(invalidId); RestApiTestUtils.validateStatusCode(response, 400); RestApiTestUtils.validateErrors(response, "mailId"); }
@Test public void getMail_unknownMail() throws Exception { final HttpResponse response = apiClient.getMail(unknownId); RestApiTestUtils.validateStatusCode(response, 404); }