* @param tagFilter
* @param store
* @return
*/
public ConflictInfo getConflictInfo(List<Service> serviceList) {
ConflictInfo conflictInfo = new ConflictInfo();
for (Service serviceA : serviceList) {
// Check for conflicts with other services
for (Service serviceB : serviceList) {
// Don't compare Service to itself!
if (!serviceA.getId().equals(serviceB.getId())) {
// NAME
if (MockeyXmlFileManager.getSafeForFileSystemName(serviceA.getServiceName()).equals(
MockeyXmlFileManager.getSafeForFileSystemName(serviceB.getServiceName()))) {
conflictInfo.addConflict(serviceA, serviceB, "Service with name'" + serviceA.getServiceName()
+ "' compared to service with name: '" + serviceB.getServiceName() + "'. Info: " + MATCH_NAME);
}
// REAL URLs
for (Url urlA : serviceA.getRealServiceUrls()) {
for (Url urlB : serviceB.getRealServiceUrls()) {
if (urlA.equals(urlB)) {
conflictInfo.addConflict(serviceA, serviceB, MATCH_REAL_URL);
}
}
}
// SAME MOCK URL
if (serviceA.getUrl() != null && serviceA.getUrl().equals(serviceB.getUrl())) {
conflictInfo.addConflict(serviceA, serviceB, MATCH_MOCK_URL);
}
}
}
// Check for conflicts with
for (Scenario scenarioA : serviceA.getScenarios()) {
for (Scenario scenarioB : serviceA.getScenarios()) {
if (scenarioA.hasSameNameAndResponse(scenarioB) && !scenarioA.getId().equals(scenarioB.getId())) {
conflictInfo.addConflict(serviceA, serviceA, MATCH_SCENARIO);
}
}
}
}