### Question:
SyncAuditServiceImpl extends BaseOpenmrsService implements SyncAuditService { @Override public String getPaginatedMessages(Integer page, Integer pageSize, Boolean success, String operation, String resourceName, String creatorInstanceId) throws APIException { PaginatedAuditMessages paginatedAuditMessages = dao.getPaginatedAuditMessages(page, pageSize, success, operation, resourceName, creatorInstanceId); return serializeResultsWithAuditMessage(paginatedAuditMessages); }  void setDao(SyncAuditDao dao); @Override AuditMessage getMessageByUuid(String uuid); @Override AuditMessage getMessageById(Integer id); @Override String getJsonMessageByUuid(String uuid); @Override String getJsonMessageById(Integer id); @Override String getPaginatedMessages(Integer page, Integer pageSize, Boolean success, String operation,
                                       String resourceName, String creatorInstanceId); @Override AuditMessage saveAuditMessageDuringSync(AuditMessage auditMessage); @Override AuditMessage saveAuditMessage(AuditMessage auditMessage); @Override AuditMessage setNextAudit(AuditMessage current, AuditMessage next); @Override Set<String> getAllCreatorIds(); @Override AuditMessage getMessageByMergeConflictUuid(String uuid); @Override String getJsonMessage(AuditMessage message);  }### Answer:
@Test public void getPaginatedMessages() throws Exception { Integer page = 1; Integer pageSize = 100; PaginatedAuditMessages messages = preparePaginatedAuditMessages(); when(dao.getPaginatedAuditMessages(page, pageSize, null, "", "", "")) .thenReturn(messages); String expected = readJsonFromFile(PAGINATED_AUDIT_MESSAGE_RESPONSE_JSON); String fetched = auditService.getPaginatedMessages( page, pageSize, null, "", "", "") + System.getProperty("line.separator"); Assert.assertEquals(expected, fetched); }