List<HistoryDto> fullHistoryList = historyService.findHistoriesBySeqNumberRange( appDto.getId(), key.getOldSeqNumber(), key.getNewSeqNumber());
@Test public void findHistoriesBySeqNumberStartTest() { List<HistoryDto> historyRows = historyService.findHistoriesBySeqNumberStart(application.getId(), 1); Assert.assertEquals(1, historyRows.size()); Assert.assertEquals(ChangeType.ADD_CONF, historyRows.get(0).getChange().getType()); }
private HistoryDto addHistory(EndpointGroupDto dto, ChangeType type, String topicId) { LOG.debug("Add history information about endpoint group update"); HistoryDto history = new HistoryDto(); history.setApplicationId(dto.getApplicationId()); ChangeDto change = new ChangeDto(); change.setEndpointGroupId(dto.getId()); change.setType(type); change.setTopicId(topicId); history.setChange(change); return historyService.saveHistory(history); }
@Test public void findHistoriesByAppIdTest() { List<HistoryDto> historyRows = historyService.findHistoriesByAppId(application.getId()); Assert.assertEquals(2, historyRows.size()); Assert.assertEquals(ChangeType.ADD_CONF, historyRows.get(0).getChange().getType()); Assert.assertEquals(ChangeType.ADD_CONF, historyRows.get(1).getChange().getType()); }
@Test public void findHistoryBySeqNumberTest() { HistoryDto history = historyService.findHistoryBySeqNumber(application.getId(), 2); Assert.assertEquals(ChangeType.ADD_CONF, history.getChange().getType()); }
@Test public void findHistoriesBySeqNumberRangeTest() { List<HistoryDto> historyRows = historyService.findHistoriesBySeqNumberRange(application.getId(), 1, 2); Assert.assertEquals(1, historyRows.size()); Assert.assertEquals(ChangeType.ADD_CONF, historyRows.get(0).getChange().getType()); }
private HistoryDto addHistory(ProfileFilterDto dto, ChangeType type) { LOG.debug("Add history information about profile filter update with change type {} ", type); HistoryDto history = new HistoryDto(); history.setApplicationId(dto.getApplicationId()); ChangeDto change = new ChangeDto(); change.setProfileFilterId(dto.getId()); change.setProfileFilterId(dto.getId()); change.setEndpointGroupId(dto.getEndpointGroupId()); change.setType(type); history.setChange(change); return historyService.saveHistory(history); }
private HistoryDto addHistory(ConfigurationDto dto, ChangeType type) { LOG.debug("Add history information about configuration update"); HistoryDto history = new HistoryDto(); history.setApplicationId(dto.getApplicationId()); ChangeDto change = new ChangeDto(); change.setConfigurationId(dto.getId()); change.setCfVersion(dto.getSchemaVersion()); change.setEndpointGroupId(dto.getEndpointGroupId()); change.setType(type); history.setChange(change); return historyService.saveHistory(history); }