@Test void testCompareMultipleScenariosAdded() { List<Scenario> baseScenarios = getScenarios(SCENARIO_NAME_1, SCENARIO_NAME_2, SCENARIO_NAME_3); List<Scenario> comparisonScenarios = getScenarios(SCENARIO_NAME_2); ScenarioDiffInfo scenarioDiffInfo = getScenarioDiffInfo(0, 0, 0, 0); initMocks(baseScenarios, comparisonScenarios, scenarioDiffInfo); UseCaseDiffInfo useCaseDiffInfo = scenarioComparator.compare(USE_CASE_NAME); double expectedChangeRate = 200.0 / 3.0; assertEquals(expectedChangeRate, useCaseDiffInfo.getChangeRate(), 0.0); assertEquals(2, useCaseDiffInfo.getAdded()); assertEquals(0, useCaseDiffInfo.getChanged()); assertEquals(0, useCaseDiffInfo.getRemoved()); assertEquals(SCENARIO_NAME_1, useCaseDiffInfo.getAddedElements().get(0)); assertEquals(SCENARIO_NAME_3, useCaseDiffInfo.getAddedElements().get(1)); assertTrue(useCaseDiffInfo.getRemovedElements().isEmpty()); }
public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); UseCaseDiffInfo compare(final String baseUseCaseName); }
ScenarioComparator extends AbstractStructureComparator<Scenario, String, ScenarioSummary> { public UseCaseDiffInfo compare(final String baseUseCaseName) { this.baseUseCaseName = baseUseCaseName; final List<Scenario> baseScenarios = scenarioDocuReader.loadScenarios(parameters.getBaseBranchName(), parameters.getBaseBuildName(), baseUseCaseName); final List<Scenario> comparisonScenarios = scenarioDocuReader.loadScenarios( parameters.getComparisonConfiguration().getComparisonBranchName(), parameters.getComparisonConfiguration().getComparisonBuildName(), baseUseCaseName); final UseCaseDiffInfo useCaseDiffInfo = new UseCaseDiffInfo(baseUseCaseName); calculateDiffInfo(baseScenarios, comparisonScenarios, useCaseDiffInfo); LOGGER.info(getLogMessage(useCaseDiffInfo, "Use Case " + parameters.getBaseBranchName() + "/" + parameters.getBaseBuildName() + "/" + baseUseCaseName)); return useCaseDiffInfo; } ScenarioComparator(ComparisonParameters parameters); UseCaseDiffInfo compare(final String baseUseCaseName);  }