public void testViewAttachmentNotAuthorised() throws Exception { Response response = attachmentClient.anonymous().getResponse("10000"); assertEquals(403, response.statusCode); assertEquals(1, response.entity.errorMessages.size()); assertTrue( response.entity.errorMessages.contains( "You do not have permission to view attachment with id: 10000")); }