- String configSnapshot = snapshot.getConfigSnapshot();
- int modulesSize = StringUtils.countMatches(configSnapshot, "<module>");
- assertEquals("Expected modules count", expectedModulesSize, modulesSize);
- int servicesSize = StringUtils.countMatches(configSnapshot, "<instance>");
- assertEquals("Expected services count", expectedServicesSize, servicesSize);
+ Document configSnapshot = readXmlToDocument(snapshot.getConfigSnapshot());
+ assertElementsCount(configSnapshot, "module", expectedModulesSize);
+ assertElementsCount(configSnapshot, "instance", expectedServicesSize);