@Test public void getJsonMessageById() throws Exception { when(dao.getMessageById(AUDIT_ID)).thenReturn(prepareAuditMessage(false)); String expected = readJsonFromFile(AUDIT_MESSAGE_JSON); String fetched = auditService.getJsonMessageById(AUDIT_ID) + System.getProperty("line.separator"); Assert.assertEquals(expected, fetched); }
@Override public String getJsonMessageById(Integer id) throws APIException, JsonParseException { AuditMessage auditMessage = dao.getMessageById(id); if (auditMessage == null) { return null; } else { return serializeResultsWithAuditMessage(auditMessage); } }
SyncAuditServiceImpl extends BaseOpenmrsService implements SyncAuditService { @Override public String getJsonMessageById(Integer id) throws APIException, JsonParseException { AuditMessage auditMessage = dao.getMessageById(id); if (auditMessage == null) { return null; } else { return serializeResultsWithAuditMessage(auditMessage); } } }
SyncAuditServiceImpl extends BaseOpenmrsService implements SyncAuditService { @Override public String getJsonMessageById(Integer id) throws APIException, JsonParseException { AuditMessage auditMessage = dao.getMessageById(id); if (auditMessage == null) { return null; } else { return serializeResultsWithAuditMessage(auditMessage); } }  }
SyncAuditServiceImpl extends BaseOpenmrsService implements SyncAuditService { @Override public String getJsonMessageById(Integer id) throws APIException, JsonParseException { AuditMessage auditMessage = dao.getMessageById(id); if (auditMessage == null) { return null; } else { return serializeResultsWithAuditMessage(auditMessage); } }  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); }
SyncAuditServiceImpl extends BaseOpenmrsService implements SyncAuditService { @Override public String getJsonMessageById(Integer id) throws APIException, JsonParseException { AuditMessage auditMessage = dao.getMessageById(id); if (auditMessage == null) { return null; } else { return serializeResultsWithAuditMessage(auditMessage); } }  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);  }