### Question:
ExecutionHistoryService { void addScenario(ExecutedScenarioWithErrorAndProblemJoin executedScenarioJoin, Map<String, ExecutedScenarioHandlingCountsDTO> qualitiesPerSeverity, String defaultSeverityCode) { final String effectiveSeverityCode = (StringUtils.isEmpty(executedScenarioJoin.getSeverity()) ? defaultSeverityCode : executedScenarioJoin.getSeverity()); if (effectiveSeverityCode != null) { addScenarioForSeverity(executedScenarioJoin, qualitiesPerSeverity, effectiveSeverityCode); } addScenarioForSeverity(executedScenarioJoin, qualitiesPerSeverity, Severity.ALL.getCode()); }  List<ExecutionHistoryPointDTO> getLatestExecutionHistories(long projectId); ExecutionHistoryPointDTO getExecution(long projectId, long id); ExecutedScenarioHandlingCountsDTO getExecutedScenarioHandlingCountsFor(Execution execution);  }### Answer:
@Test public void addScenario_should_increment_severity_and_global() { ExecutedScenarioWithErrorAndProblemJoin executedScenarioJoin = new ExecutedScenarioWithErrorAndProblemJoin() .withSeverity("medium"); Map<String, ExecutedScenarioHandlingCountsDTO> qualitiesPerSeverity = new HashMap<>(); cut.addScenario(executedScenarioJoin, qualitiesPerSeverity, "medium"); assertThat(qualitiesPerSeverity.size()).isEqualTo(2); assertThat(qualitiesPerSeverity.get("medium").getTotal()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("medium").getPassed()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("*").getTotal()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("*").getPassed()).isEqualTo(1); }
@Test public void addScenario_should_increment_severity_and_global_for_default_severity() { ExecutedScenarioWithErrorAndProblemJoin executedScenarioJoin = new ExecutedScenarioWithErrorAndProblemJoin() .withSeverity(""); Map<String, ExecutedScenarioHandlingCountsDTO> qualitiesPerSeverity = new HashMap<>(); cut.addScenario(executedScenarioJoin, qualitiesPerSeverity, "medium"); assertThat(qualitiesPerSeverity.size()).isEqualTo(2); assertThat(qualitiesPerSeverity.get("medium").getTotal()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("medium").getPassed()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("*").getTotal()).isEqualTo(1); assertThat(qualitiesPerSeverity.get("*").getPassed()).isEqualTo(1); }