com.indeed.proctor.common.model.TestMatrixArtifact Maven / Gradle / Ivy
package com.indeed.proctor.common.model;
import com.google.common.collect.Maps;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
/**
* Represents the entirety of the test specification artifact as the consumers should consume it
*
* @author ketan
*/
public class TestMatrixArtifact {
@Nullable private Audit audit;
@Nonnull private Map tests = new HashMap<>();
@Nullable
public Audit getAudit() {
return audit;
}
public void setAudit(@Nullable final Audit audit) {
this.audit = audit;
}
/* TODO: move somewhere better */
public static Map collectionsToSets(
@Nonnull final Map inputMap) {
final Map newMap = Maps.newHashMap();
for (final Entry entry : inputMap.entrySet()) {
final String key = entry.getKey();
final Object value = entry.getValue();
if (value instanceof Collection) {
newMap.put(key, new HashSet