com.testvagrant.optimus.utils.DataStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optimus Show documentation
Show all versions of optimus Show documentation
Mobile test automation library
package com.testvagrant.optimus.utils;
import com.testvagrant.commons.entities.reportParser.ExecutedScenario;
import com.testvagrant.optimus.entity.ExceptionEntity;
import java.util.*;
public class DataStore {
private List failedScenarios;
private Map> failedScenarioMap;
public DataStore() {
failedScenarioMap = new HashMap<>();
failedScenarios = new ArrayList<>();
}
public void store(ExceptionEntity exceptionEntity, ExecutedScenario scenario) {
failedScenarioMap.put(exceptionEntity.getName(), getUpdatedRecords(failedScenarioMap,exceptionEntity.getName(),scenario));
}
private List getUpdatedRecords(Map> key, String exceptionKey, ExecutedScenario scenario) {
ArrayList list = new ArrayList<>();
if(key.containsKey(exceptionKey)) {
list.addAll(key.get(exceptionKey));
}
list.add(scenario);
return list;
}
public Map> getFailedScenarioMap() {
return failedScenarioMap;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy