store.deleteEverything();
// ***************************
// New Store
// ***************************
Service service = new Service();
service.setServiceName("Service 1");
Scenario scenario = new Scenario();
scenario.setScenarioName("ABC");
scenario.setTag("abc");
service.saveOrUpdateScenario(scenario);
store.saveOrUpdateService(service);
// ***************************
// Get the store as XML
// ***************************
String storeAsXml = getStoreAsXml();
// ***************************
// Rebuild the store with:
// - Same Service, same scenario
// - Service scenario has different tag
// ***************************
store.deleteEverything();
service = new Service();
service.setServiceName("Service 1");
scenario = new Scenario();
scenario.setScenarioName("ABC");
scenario.setTag("def");
service.saveOrUpdateScenario(scenario);
store.saveOrUpdateService(service);
// ***************************
// Upload/Merge the store again.
// Result should be 1 Service in the store with 2 Real URLS (merged)
// ***************************
getMergeResults(storeAsXml);
List<Service> storeServices = store.getServices();
assert (storeServices.size() == 1) : "Number of Services in the Store should have been 1 but was "
+ storeServices.size();
Service serviceToTest = storeServices.get(0);
List<Scenario> scenarioList = serviceToTest.getScenarios();
assert (scenarioList.size() == 1) : "Number of Service scenarios in the Store should have been 1 but was "
+ scenarioList.size()
+ " with value: \n"
+ getScenarioListAsString(scenarioList);