com.testvagrant.monitor.services.IntellisenseServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optimusmonitor Show documentation
Show all versions of optimusmonitor Show documentation
The Java Client provides access to Optimus cloud for all java based projects.
The newest version!
package com.testvagrant.monitor.services;
import com.google.gson.GsonBuilder;
import com.testvagrant.monitor.clients.IntellisenseClient;
import com.testvagrant.monitor.entities.reportParser.ExecutedScenario;
import com.testvagrant.monitor.requests.Intellisense;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IntellisenseServiceImpl extends OptimusServiceImpl implements IntellisenseService {
@Override
public void writeFailedScenariosByException(Map> failedScenariosMap) {
Map> failedScenariosObjectMap = new HashMap<>();
failedScenariosMap.keySet().forEach(key -> {
List scenarios = failedScenariosMap.get(key);
List scenarioIds = new ArrayList();
scenarios.forEach(scenario -> {
String latestRecordFor = new ScenariosServiceImpl().getLatestRecordFor(scenario);
scenarioIds.add(latestRecordFor);
});
failedScenariosObjectMap.put(key,scenarioIds);
});
String exceptions = new GsonBuilder().disableHtmlEscaping().create().toJson(failedScenariosObjectMap);
Intellisense intellisense = new Intellisense();
intellisense.setBuildId(getLatestBuild());
intellisense.setExceptionsense(exceptions);
new IntellisenseClient().recordExceptionSense(intellisense);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy