Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.vertx.core.Vertx;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.collections4.map.DefaultedMap;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -155,7 +156,7 @@ private static ExecutionPlan parseExecutionPlan(String executionPlan, JacksonMap
}

private static ExecutionPlan validateExecutionPlan(ExecutionPlan plan, HookCatalog hookCatalog) {
plan.getEndpoints().values().stream()
MapUtils.emptyIfNull(plan.getEndpoints()).values().stream()
.map(EndpointExecutionPlan::getStages)
.map(Map::entrySet)
.flatMap(Collection::stream)
Expand Down Expand Up @@ -412,8 +413,7 @@ private StageExecutionPlan effectiveStagePlanFrom(
}

private static StageExecutionPlan stagePlanFrom(ExecutionPlan executionPlan, Endpoint endpoint, Stage stage) {
return executionPlan
.getEndpoints()
return MapUtils.emptyIfNull(executionPlan.getEndpoints())
.getOrDefault(endpoint, EndpointExecutionPlan.empty())
.getStages()
.getOrDefault(stage, StageExecutionPlan.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import lombok.Value;
import org.prebid.server.model.Endpoint;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Value(staticConstructor = "of")
public class ExecutionPlan {

private static final ExecutionPlan EMPTY = of(null, Collections.emptyMap());
private static final ExecutionPlan EMPTY = of(null, null);

@JsonProperty("abtests")
List<ABTest> abTests;
Expand Down
Loading