use of com.emc.storageos.svcs.errorhandling.utils.Documenter.DocumenterEntry in project coprhd-controller by CoprHD.
the class DocumenterTest method serviceCodeToStatus.
@Test
public void serviceCodeToStatus() {
final Collection<DocumenterEntry> entries = Documenter.createEntries();
final Map<ServiceCode, Set<StatusType>> serviceToStatus = new HashMap<ServiceCode, Set<StatusType>>();
for (final DocumenterEntry entry : entries) {
if (!serviceToStatus.containsKey(entry.getCode())) {
serviceToStatus.put(entry.getCode(), new HashSet<StatusType>());
}
serviceToStatus.get(entry.getCode()).add(entry.getStatus());
}
final Map<ServiceCode, Set<StatusType>> failures = new HashMap<ServiceCode, Set<StatusType>>();
for (final Entry<ServiceCode, Set<StatusType>> entry : serviceToStatus.entrySet()) {
if (entry.getValue().size() > 1) {
failures.put(entry.getKey(), entry.getValue());
}
}
assertTrue("Some service codes map to more than one HTTP status code: " + failures, failures.isEmpty());
}
Aggregations