EventLogServiceImpl implements EventLogService { public String getLayoutByLogId(Integer userId, Integer logId) { String layout = dashboardLayoutRepository.findByUserIdAndLogId(userId, logId); return layout; } @Inject  EventLogServiceImpl(final LogRepository logRepository, final GroupRepository groupRepository,
                               final GroupLogRepository groupLogRepository, final FolderRepository folderRepo,
                               final UserService userSrv, final UserInterfaceHelper ui,
                               final StatisticRepository statisticRepository, final ConfigBean configBean, final DashboardLayoutRepository dashboardLayoutRepository); static XLog importFromStream(XFactory factory, InputStream is, String extension); @Override SummariesType readLogSummaries(Integer folderId, String searchExpression); @Override Log importLog(String username, Integer folderId, String logName, InputStream inputStreamLog,
                         String extension, String domain, String created, boolean publicModel); @Override void updateLogMetaData(Integer logId, String logName, boolean isPublic); @Override boolean isPublicLog(Integer logId); @Override ExportLogResultType exportLog(Integer logId); @Override void cloneLog(String username, Integer folderId, String logName, Integer sourceLogId,
                  String domain, String created, boolean publicModel); @Override XLog getXLog(Integer logId); @Override XLog getXLog(Integer logId, String factoryName); @Override XLog getXLogWithStats(Integer logId); List<Statistic> getStats(Integer logId); List<?> getStatsByType(Integer logId, StatType statType); @Override boolean isStatsExists(Integer logId, StatType statType); @Override void storeStats(Map<String, Map<String, Integer>> map, Integer logId); void storeStatsByType(Map<String, Map<String, String>> map, Integer logId, StatType statType); List<Statistic> flattenNestedStringMap(Map<String, Map<String, String>> map, Integer logId,
                                                  StatType statType); List<Statistic> flattenNestedMap(Map<String, Map<String, Integer>> map, Integer logId); @Override void deleteLogs(List<Log> logs, User user); @Override void exportToStream(OutputStream outputStream, XLog log); @Override APMLog getAggregatedLog(Integer logId); String getLayoutByLogId(Integer userId, Integer logId); void saveLayoutByLogId(Integer logId, Integer userId, String layout); static final String PARENT_NODE_FLAG; static final String STAT_NODE_NAME; }
@Test public void getLayoutByLogId() { Integer userId = 1; Integer logId = 1; String reallyLongString = "a really long String"; expect(dashboardLayoutRepository.findByUserIdAndLogId(userId, logId)).andReturn(reallyLongString); replay(dashboardLayoutRepository); String result = eventLogService.getLayoutByLogId(userId, logId); verify(dashboardLayoutRepository); assertThat(result, equalTo(reallyLongString)); }