diff --git a/extra/bundle/pom.xml b/extra/bundle/pom.xml
index 3cae168fb2b..03982fe0d00 100644
--- a/extra/bundle/pom.xml
+++ b/extra/bundle/pom.xml
@@ -32,7 +32,7 @@
org.prebid.server.hooks.modules
- ortb2-blocking
+ pb-ortb2-blocking
${project.version}
diff --git a/extra/modules/fiftyone-devicedetection/README.md b/extra/modules/fiftyone-devicedetection/README.md
index fbe254b28c1..cf6d22d1843 100644
--- a/extra/modules/fiftyone-devicedetection/README.md
+++ b/extra/modules/fiftyone-devicedetection/README.md
@@ -178,4 +178,4 @@ curl http://localhost:8080/openrtb2/auction --data @extra/modules/fiftyone-devic
Any suggestions or questions can be directed to [support@51degrees.com](support@51degrees.com) e-mail.
-Or just open new [issue](https://github.com/prebid/prebid-server-java/issues/new) or [pull request](https://github.com/prebid/prebid-server-java/pulls) in this repository.
\ No newline at end of file
+Or just open new [issue](https://github.com/prebid/prebid-server-java/issues/new) or [pull request](https://github.com/prebid/prebid-server-java/pulls) in this repository.
diff --git a/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHook.java b/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHook.java
index f0bd5467d0e..121c9f6c3a3 100644
--- a/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHook.java
+++ b/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHook.java
@@ -53,7 +53,7 @@
public class GreenbidsRealTimeDataProcessedAuctionRequestHook implements ProcessedAuctionRequestHook {
private static final String BID_REQUEST_ANALYTICS_EXTENSION_NAME = "greenbids-rtd";
- private static final String CODE = "greenbids-real-time-data-processed-auction-request";
+ private static final String CODE = "greenbids-real-time-data-processed-auction-request-hook";
private static final String ACTIVITY = "greenbids-filter";
private static final String SUCCESS_STATUS = "success";
diff --git a/extra/modules/ortb2-blocking/README.md b/extra/modules/pb-ortb2-blocking/README.md
similarity index 100%
rename from extra/modules/ortb2-blocking/README.md
rename to extra/modules/pb-ortb2-blocking/README.md
diff --git a/extra/modules/ortb2-blocking/pom.xml b/extra/modules/pb-ortb2-blocking/pom.xml
similarity index 86%
rename from extra/modules/ortb2-blocking/pom.xml
rename to extra/modules/pb-ortb2-blocking/pom.xml
index 0969d6f8a41..352c9b5e6b9 100644
--- a/extra/modules/ortb2-blocking/pom.xml
+++ b/extra/modules/pb-ortb2-blocking/pom.xml
@@ -8,8 +8,8 @@
3.42.0-SNAPSHOT
- ortb2-blocking
+ pb-ortb2-blocking
- ortb2-blocking
+ pb-ortb2-blocking
OpenRTB2 Blocking module
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReader.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReader.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReader.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReader.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlocker.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlocker.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlocker.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlocker.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolver.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolver.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolver.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolver.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdater.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdater.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdater.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdater.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdater.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdater.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdater.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdater.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/exception/InvalidAccountConfigurationException.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/exception/InvalidAccountConfigurationException.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/exception/InvalidAccountConfigurationException.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/exception/InvalidAccountConfigurationException.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/AnalyticsResult.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/AnalyticsResult.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/AnalyticsResult.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/AnalyticsResult.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BidAttributeBlockingConfig.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BidAttributeBlockingConfig.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BidAttributeBlockingConfig.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BidAttributeBlockingConfig.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedAttributes.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedAttributes.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedAttributes.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedAttributes.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedBids.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedBids.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedBids.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/BlockedBids.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ExecutionResult.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ExecutionResult.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ExecutionResult.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ExecutionResult.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ResponseBlockingConfig.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ResponseBlockingConfig.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ResponseBlockingConfig.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/ResponseBlockingConfig.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/Result.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/Result.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/Result.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/model/Result.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/util/MergeUtils.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/util/MergeUtils.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/util/MergeUtils.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/core/util/MergeUtils.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContext.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContext.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContext.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContext.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/spring/config/Ortb2BlockingModuleConfiguration.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/spring/config/Ortb2BlockingModuleConfiguration.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/spring/config/Ortb2BlockingModuleConfiguration.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/spring/config/Ortb2BlockingModuleConfiguration.java
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java
similarity index 98%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java
index e13deb60d3d..ca2dfb9fabb 100644
--- a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java
+++ b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHook.java
@@ -26,7 +26,7 @@
public class Ortb2BlockingBidderRequestHook implements BidderRequestHook {
- private static final String CODE = "ortb2-blocking-bidder-request";
+ private static final String CODE = "pb-ortb2-blocking-bidder-request-hook";
private final BidderCatalog bidderCatalog;
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java
similarity index 94%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java
index 747728c0d40..aa432e263ac 100644
--- a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java
+++ b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingModule.java
@@ -12,7 +12,7 @@
public class Ortb2BlockingModule implements Module {
- public static final String CODE = "ortb2-blocking";
+ public static final String CODE = "pb-ortb2-blocking";
private final List extends Hook, ? extends InvocationContext>> hooks;
diff --git a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java
similarity index 98%
rename from extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java
rename to extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java
index 94271ff7ca5..015c653250d 100644
--- a/extra/modules/ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java
+++ b/extra/modules/pb-ortb2-blocking/src/main/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHook.java
@@ -34,7 +34,7 @@
public class Ortb2BlockingRawBidderResponseHook implements RawBidderResponseHook {
- private static final String CODE = "ortb2-blocking-raw-bidder-response";
+ private static final String CODE = "pb-ortb2-blocking-raw-bidder-response-hook";
private static final String ENFORCE_BLOCKING_ACTIVITY = "enforce-blocking";
private static final String SUCCESS_STATUS = "success";
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReaderTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReaderTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReaderTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/AccountConfigReaderTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlockerTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlockerTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlockerTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BidsBlockerTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolverTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolverTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolverTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/BlockedAttributesResolverTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdaterTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdaterTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdaterTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/RequestUpdaterTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdaterTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdaterTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdaterTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/ResponseUpdaterTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AllowedForDealsOverride.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AllowedForDealsOverride.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AllowedForDealsOverride.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AllowedForDealsOverride.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ArrayOverride.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ArrayOverride.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ArrayOverride.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ArrayOverride.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attribute.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attribute.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attribute.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attribute.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AttributeActionOverrides.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AttributeActionOverrides.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AttributeActionOverrides.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/AttributeActionOverrides.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attributes.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attributes.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attributes.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Attributes.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/BooleanOverride.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/BooleanOverride.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/BooleanOverride.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/BooleanOverride.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Conditions.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Conditions.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Conditions.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/Conditions.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/DealsConditions.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/DealsConditions.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/DealsConditions.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/DealsConditions.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ModuleConfig.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ModuleConfig.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ModuleConfig.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/core/config/ModuleConfig.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContextTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContextTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContextTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/model/ModuleContextTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHookTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHookTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHookTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingBidderRequestHookTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHookTest.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHookTest.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHookTest.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/Ortb2BlockingRawBidderResponseHookTest.java
diff --git a/extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/model/BidderInvocationContextImpl.java b/extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/model/BidderInvocationContextImpl.java
similarity index 100%
rename from extra/modules/ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/model/BidderInvocationContextImpl.java
rename to extra/modules/pb-ortb2-blocking/src/test/java/org/prebid/server/hooks/modules/ortb2/blocking/v1/model/BidderInvocationContextImpl.java
diff --git a/extra/modules/pb-request-correction/src/main/java/org/prebid/server/hooks/modules/pb/request/correction/v1/RequestCorrectionProcessedAuctionHook.java b/extra/modules/pb-request-correction/src/main/java/org/prebid/server/hooks/modules/pb/request/correction/v1/RequestCorrectionProcessedAuctionHook.java
index 215e9795110..13e28483778 100644
--- a/extra/modules/pb-request-correction/src/main/java/org/prebid/server/hooks/modules/pb/request/correction/v1/RequestCorrectionProcessedAuctionHook.java
+++ b/extra/modules/pb-request-correction/src/main/java/org/prebid/server/hooks/modules/pb/request/correction/v1/RequestCorrectionProcessedAuctionHook.java
@@ -23,7 +23,7 @@
public class RequestCorrectionProcessedAuctionHook implements ProcessedAuctionRequestHook {
- private static final String CODE = "pb-request-correction-processed-auction-request";
+ private static final String CODE = "pb-request-correction-processed-auction-request-hook";
private final RequestCorrectionProvider requestCorrectionProvider;
private final ObjectMapper mapper;
diff --git a/extra/modules/pb-response-correction/src/main/java/org/prebid/server/hooks/modules/pb/response/correction/v1/ResponseCorrectionAllProcessedBidResponsesHook.java b/extra/modules/pb-response-correction/src/main/java/org/prebid/server/hooks/modules/pb/response/correction/v1/ResponseCorrectionAllProcessedBidResponsesHook.java
index 11c740e9771..40dc1c0a3d0 100644
--- a/extra/modules/pb-response-correction/src/main/java/org/prebid/server/hooks/modules/pb/response/correction/v1/ResponseCorrectionAllProcessedBidResponsesHook.java
+++ b/extra/modules/pb-response-correction/src/main/java/org/prebid/server/hooks/modules/pb/response/correction/v1/ResponseCorrectionAllProcessedBidResponsesHook.java
@@ -24,7 +24,7 @@
public class ResponseCorrectionAllProcessedBidResponsesHook implements AllProcessedBidResponsesHook {
- private static final String CODE = "pb-response-correction-all-processed-bid-responses";
+ private static final String CODE = "pb-response-correction-all-processed-bid-responses-hook";
private final ResponseCorrectionProvider responseCorrectionProvider;
private final ObjectMapper mapper;
diff --git a/extra/modules/pb-rule-engine/src/main/java/org/prebid/server/hooks/modules/rule/engine/v1/PbRuleEngineProcessedAuctionRequestHook.java b/extra/modules/pb-rule-engine/src/main/java/org/prebid/server/hooks/modules/rule/engine/v1/PbRuleEngineProcessedAuctionRequestHook.java
index 2f20d25ffa6..8d405568266 100644
--- a/extra/modules/pb-rule-engine/src/main/java/org/prebid/server/hooks/modules/rule/engine/v1/PbRuleEngineProcessedAuctionRequestHook.java
+++ b/extra/modules/pb-rule-engine/src/main/java/org/prebid/server/hooks/modules/rule/engine/v1/PbRuleEngineProcessedAuctionRequestHook.java
@@ -30,7 +30,7 @@
public class PbRuleEngineProcessedAuctionRequestHook implements ProcessedAuctionRequestHook {
- private static final String CODE = "pb-rule-engine-processed-auction-request";
+ private static final String CODE = "pb-rule-engine-processed-auction-request-hook";
private final RuleParser ruleParser;
private final String datacenter;
diff --git a/extra/modules/pom.xml b/extra/modules/pom.xml
index af20f6f2626..e7995123c8b 100644
--- a/extra/modules/pom.xml
+++ b/extra/modules/pom.xml
@@ -17,17 +17,18 @@
Umbrellas all PBS modules
- ortb2-blocking
- confiant-ad-quality
+ pb-ortb2-blocking
pb-richmedia-filter
- fiftyone-devicedetection
pb-response-correction
- greenbids-real-time-data
pb-request-correction
+ pb-rule-engine
+
+ confiant-ad-quality
+ fiftyone-devicedetection
+ greenbids-real-time-data
optable-targeting
wurfl-devicedetection
live-intent-omni-channel-identity
- pb-rule-engine
diff --git a/src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy b/src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy
index 19a29ae0058..e0ac38eba61 100644
--- a/src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy
+++ b/src/test/groovy/org/prebid/server/functional/model/ModuleName.groovy
@@ -6,10 +6,10 @@ enum ModuleName {
PB_RICHMEDIA_FILTER("pb-richmedia-filter"),
PB_RESPONSE_CORRECTION ("pb-response-correction"),
- ORTB2_BLOCKING("ortb2-blocking"),
+ PB_ORTB2_BLOCKING("pb-ortb2-blocking"),
PB_REQUEST_CORRECTION('pb-request-correction'),
- OPTABLE_TARGETING('optable-targeting'),
- PB_RULE_ENGINE('pb-rule-engine')
+ PB_RULE_ENGINE('pb-rule-engine'),
+ OPTABLE_TARGETING('optable-targeting')
@JsonValue
final String code
diff --git a/src/test/groovy/org/prebid/server/functional/model/config/ExecutionGroup.groovy b/src/test/groovy/org/prebid/server/functional/model/config/ExecutionGroup.groovy
index eb32b75e729..d7413f86a31 100644
--- a/src/test/groovy/org/prebid/server/functional/model/config/ExecutionGroup.groovy
+++ b/src/test/groovy/org/prebid/server/functional/model/config/ExecutionGroup.groovy
@@ -19,7 +19,7 @@ class ExecutionGroup {
static ExecutionGroup getModuleExecutionGroup(ModuleName name, Stage stage) {
new ExecutionGroup().tap {
timeout = 1000
- hookSequence = [new HookId(moduleCode: name.code, hookImplCode: ModuleHookImplementation.forValue(name, stage).code)]
+ hookSequence = [new HookId(moduleCode: name.code, hookImplCode: "${name.code}-$stage-hook")]
}
}
}
diff --git a/src/test/groovy/org/prebid/server/functional/model/config/ModuleHookImplementation.groovy b/src/test/groovy/org/prebid/server/functional/model/config/ModuleHookImplementation.groovy
deleted file mode 100644
index af7bf670c95..00000000000
--- a/src/test/groovy/org/prebid/server/functional/model/config/ModuleHookImplementation.groovy
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.prebid.server.functional.model.config
-
-import com.fasterxml.jackson.annotation.JsonValue
-import org.prebid.server.functional.model.ModuleName
-
-//TODO remove if module hooks implementation codes will become consistent
-enum ModuleHookImplementation {
-
- PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES("pb-richmedia-filter-all-processed-bid-responses-hook"),
- RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES("pb-response-correction-all-processed-bid-responses"),
- ORTB2_BLOCKING_BIDDER_REQUEST("ortb2-blocking-bidder-request"),
- ORTB2_BLOCKING_RAW_BIDDER_RESPONSE("ortb2-blocking-raw-bidder-response"),
- PB_REQUEST_CORRECTION_PROCESSED_AUCTION_REQUEST("pb-request-correction-processed-auction-request"),
- OPTABLE_TARGETING_PROCESSED_AUCTION_REQUEST("optable-targeting-processed-auction-request-hook"),
- PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST("pb-rule-engine-processed-auction-request")
-
- @JsonValue
- final String code
-
- ModuleHookImplementation(String code) {
- this.code = code
- }
-
- static ModuleHookImplementation forValue(ModuleName name, Stage stage) {
- values().find { it.code.contains(name.code) && it.code.contains(stage.value) }
- }
-}
diff --git a/src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy b/src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy
index ac2685742b6..0c42cc36950 100644
--- a/src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy
+++ b/src/test/groovy/org/prebid/server/functional/model/config/PbsModulesConfig.groovy
@@ -10,9 +10,9 @@ import org.prebid.server.functional.model.request.auction.RichmediaFilter
class PbsModulesConfig {
RichmediaFilter pbRichmediaFilter
- Ortb2BlockingConfig ortb2Blocking
+ Ortb2BlockingConfig pbOrtb2Blocking
PbResponseCorrection pbResponseCorrection
PbRequestCorrectionConfig pbRequestCorrection
- OptableTargetingConfig optableTargeting
PbRulesEngine pbRuleEngine
+ OptableTargetingConfig optableTargeting
}
diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleError.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleError.groovy
index 138b5e40507..b722d2988ac 100644
--- a/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleError.groovy
+++ b/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleError.groovy
@@ -8,5 +8,5 @@ import groovy.transform.ToString
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
class ModuleError {
- Map> ortb2Blocking
+ Map> pbOrtb2Blocking
}
diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleWarning.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleWarning.groovy
index 5c6d4ebed44..18931b0c053 100644
--- a/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleWarning.groovy
+++ b/src/test/groovy/org/prebid/server/functional/model/response/auction/ModuleWarning.groovy
@@ -8,5 +8,5 @@ import groovy.transform.ToString
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy)
class ModuleWarning {
- Map> ortb2Blocking
+ Map> pbOrtb2Blocking
}
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy
index 1582f3b200d..f7d366602fd 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/AbTestingModuleSpec.groovy
@@ -17,9 +17,6 @@ import org.prebid.server.functional.util.PBSUtils
import static org.prebid.server.functional.model.ModuleName.PB_RESPONSE_CORRECTION
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.ORTB2_BLOCKING_BIDDER_REQUEST
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.ORTB2_BLOCKING_RAW_BIDDER_RESPONSE
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
import static org.prebid.server.functional.model.config.Stage.BIDDER_REQUEST
import static org.prebid.server.functional.model.config.Stage.RAW_BIDDER_RESPONSE
@@ -33,15 +30,12 @@ import static org.prebid.server.functional.model.response.auction.ResponseAction
class AbTestingModuleSpec extends ModuleBaseSpec {
- private final static String NO_INVOCATION_METRIC = "modules.module.%s.stage.%s.hook.%s.success.no-invocation"
- private final static String CALL_METRIC = "modules.module.%s.stage.%s.hook.%s.call"
- private final static String EXECUTION_ERROR_METRIC = "modules.module.%s.stage.%s.hook.%s.execution-error"
private final static Integer MIN_PERCENT_AB = 0
private final static Integer MAX_PERCENT_AB = 100
private final static String INVALID_HOOK_MESSAGE = "Hook implementation does not exist or disabled"
- private final static Map> ORTB_STAGES = [(BIDDER_REQUEST) : [ModuleName.ORTB2_BLOCKING],
- (RAW_BIDDER_RESPONSE): [ModuleName.ORTB2_BLOCKING]]
+ private final static Map> ORTB_STAGES = [(BIDDER_REQUEST) : [ModuleName.PB_ORTB2_BLOCKING],
+ (RAW_BIDDER_RESPONSE): [ModuleName.PB_ORTB2_BLOCKING]]
private final static Map> RESPONSE_STAGES = [(ALL_PROCESSED_BID_RESPONSES): [PB_RESPONSE_CORRECTION]]
private final static Map> MODULES_STAGES = ORTB_STAGES + RESPONSE_STAGES
@@ -64,7 +58,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
flushMetrics(ortbModulePbsService)
and: "Save account with ab test config"
- def abTest = AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ def abTest = AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
enabled = false
}
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
@@ -89,13 +83,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be as default call"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
}
def "PBS shouldn't apply valid a/b test config when module is disabled"() {
@@ -111,7 +105,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code)]
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code)]
}
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(executionPlan: executionPlan))
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
@@ -131,15 +125,15 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be with error call"
def metrics = prebidServerService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[EXECUTION_ERROR_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[EXECUTION_ERROR_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[EXECUTION_ERROR_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[EXECUTION_ERROR_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -175,16 +169,16 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be as default call"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
where:
- moduleName << [ModuleName.ORTB2_BLOCKING.code.toUpperCase(), PBSUtils.randomString]
+ moduleName << [ModuleName.PB_ORTB2_BLOCKING.code.toUpperCase(), PBSUtils.randomString]
}
def "PBS should apply a/b test config for each module when multiple config are presents and set to allow modules"() {
@@ -195,7 +189,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
flushMetrics(pbsServiceWithMultipleModules)
and: "Save account with ab test config"
- def ortb2AbTestConfig = AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ def ortb2AbTestConfig = AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = MAX_PERCENT_AB
}
def richMediaAbTestConfig = AbTest.getDefault(PB_RESPONSE_CORRECTION.code).tap {
@@ -213,14 +207,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for specified module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION]
it.analyticsTags.activities.name.flatten().sort() == [ORTB2_BLOCKING, AB_TESTING, AB_TESTING].value.sort()
it.analyticsTags.activities.status.flatten().sort() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS, FetchStatus.SUCCESS].sort()
it.analyticsTags.activities.results.status.flatten().sort() == [FetchStatus.SUCCESS_ALLOW, FetchStatus.RUN, FetchStatus.RUN].sort()
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "PBS should not apply ab test config for other module"
@@ -234,18 +228,18 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.results.values.module.flatten() == [PB_RESPONSE_CORRECTION]
}
- and: "Metric for allowed to run ortb2blocking module should be updated based on ab test config"
+ and: "Metric for allowed to run pb-ortb2blocking module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
-
- and: "Metric for allowed to run response-correction module should be updated based on ab test config"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+
+ and: "Metric for allowed to run pb-response-correction module should be updated based on ab test config"
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
}
def "PBS should apply a/b test config for each module when multiple config are presents and set to skip modules"() {
@@ -256,7 +250,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
flushMetrics(pbsServiceWithMultipleModules)
and: "Save account with ab test config"
- def ortb2AbTestConfig = AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ def ortb2AbTestConfig = AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = MIN_PERCENT_AB
}
def richMediaAbTestConfig = AbTest.getDefault(PB_RESPONSE_CORRECTION.code).tap {
@@ -274,17 +268,17 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for ortb2blocking module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
- and: "PBS should apply ab test config for response-correction module"
+ and: "PBS should apply ab test config for pb-response-correction module"
def responseCorrectionInvocationResults = filterInvocationResultsByModule(invocationResults, PB_RESPONSE_CORRECTION)
verifyAll(responseCorrectionInvocationResults) {
it.status == [SUCCESS]
@@ -295,18 +289,18 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.results.values.module.flatten() == [PB_RESPONSE_CORRECTION]
}
- and: "Metric for skipped ortb2blocking module should be updated based on ab test config"
+ and: "Metric for skipped pb-ortb2blocking module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
-
- and: "Metric for skipped response-correction module should be updated based on ab test config"
- assert !metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert !metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+
+ and: "Metric for skipped pb-response-correction module should be updated based on ab test config"
+ assert !metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
}
def "PBS should apply a/b test config for each module when multiple config are presents with different percentage"() {
@@ -317,7 +311,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
flushMetrics(pbsServiceWithMultipleModules)
and: "Save account with ab test config"
- def ortb2AbTestConfig = AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ def ortb2AbTestConfig = AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = MIN_PERCENT_AB
}
def richMediaAbTestConfig = AbTest.getDefault(PB_RESPONSE_CORRECTION.code).tap {
@@ -335,17 +329,17 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for ortb2blocking module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
- and: "PBS should not apply ab test config for response-correction module"
+ and: "PBS should not apply ab test config for pb-response-correction module"
def responseCorrectionInvocationResults = filterInvocationResultsByModule(invocationResults, PB_RESPONSE_CORRECTION)
verifyAll(responseCorrectionInvocationResults) {
it.status == [SUCCESS]
@@ -358,14 +352,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for skipped ortb2blocking module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
-
- and: "Metric for allowed to run response-correction module should be updated based on ab test config"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+
+ and: "Metric for allowed to run pb-response-correction module should be updated based on ab test config"
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
}
def "PBS should ignore accounts property for a/b test config when ab test config specialize for specific account"() {
@@ -377,7 +371,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code, [PBSUtils.randomNumber]).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code, [PBSUtils.randomNumber]).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -396,13 +390,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be updated based on ab test config"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
}
def "PBS should apply a/b test config and run module when config is on max percentage or default value"() {
@@ -414,7 +408,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = percentActive
it.percentActiveSnakeCase = percentActiveSnakeCase
}]
@@ -434,18 +428,18 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten().sort() == [ORTB2_BLOCKING, AB_TESTING, AB_TESTING].value.sort()
it.analyticsTags.activities.status.flatten().sort() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS, FetchStatus.SUCCESS].sort()
it.analyticsTags.activities.results.status.flatten().sort() == [FetchStatus.SUCCESS_ALLOW, FetchStatus.RUN, FetchStatus.RUN].sort()
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be as default call"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
where:
percentActive | percentActiveSnakeCase
@@ -463,7 +457,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = percentActive
it.percentActiveSnakeCase = percentActiveSnakeCase
}]
@@ -483,13 +477,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be updated based on ab test config"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
where:
percentActive | percentActiveSnakeCase
@@ -506,7 +500,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = percentActive
it.percentActiveSnakeCase = percentActiveSnakeCase
}]
@@ -530,13 +524,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be updated based on ab test config"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
where:
percentActive | percentActiveSnakeCase
@@ -553,7 +547,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
it.percentActive = percentActive
it.percentActiveSnakeCase = percentActiveSnakeCase
}]
@@ -578,18 +572,18 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten().sort() == [ORTB2_BLOCKING, AB_TESTING, AB_TESTING].value.sort()
it.analyticsTags.activities.status.flatten().sort() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS, FetchStatus.SUCCESS].sort()
it.analyticsTags.activities.results.status.flatten().sort() == [FetchStatus.SUCCESS_ALLOW, FetchStatus.RUN, FetchStatus.RUN].sort()
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be as default call"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
where:
percentActive | percentActiveSnakeCase
@@ -606,7 +600,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = MIN_PERCENT_AB
it.logAnalyticsTag = logAnalyticsTag
it.logAnalyticsTagSnakeCase = logAnalyticsTagSnakeCase
@@ -627,13 +621,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "Metric for specified module should be updated based on ab test config"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
where:
logAnalyticsTag | logAnalyticsTagSnakeCase
@@ -651,7 +645,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = MIN_PERCENT_AB
it.logAnalyticsTag = logAnalyticsTag
it.logAnalyticsTagSnakeCase = logAnalyticsTagSnakeCase
@@ -676,8 +670,8 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be updated based on ab test config"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
where:
logAnalyticsTag | logAnalyticsTagSnakeCase
@@ -694,7 +688,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = MAX_PERCENT_AB
it.logAnalyticsTag = logAnalyticsTag
it.logAnalyticsTagSnakeCase = logAnalyticsTagSnakeCase
@@ -719,13 +713,13 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be as default call"
def metrics = ortbModulePbsService.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
where:
logAnalyticsTag | logAnalyticsTagSnakeCase
@@ -742,7 +736,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = PBSUtils.getRandomNumber(MIN_PERCENT_AB, MAX_PERCENT_AB)
}]
}
@@ -772,7 +766,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def "PBS should apply a/b test config from host config when accounts is not specified when account config and default account doesn't include a/b test config"() {
given: "PBS service with specific ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code, accouns).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code, accouns).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -790,14 +784,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for specified module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "PBS should not apply ab test config for other module"
@@ -811,15 +805,15 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "Metric for non specified module should be as default call"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -832,7 +826,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
given: "PBS service with specific ab test config"
def accountId = PBSUtils.randomNumber
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code, [PBSUtils.randomNumber, accountId]).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code, [PBSUtils.randomNumber, accountId]).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -853,14 +847,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for specified module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "PBS should not apply ab test config for other module"
@@ -874,15 +868,15 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "Metric for non specified module should be as default call"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -891,7 +885,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def "PBS should apply a/b test config from host config for specific account and general config when account config and default account doesn't include a/b test config"() {
given: "PBS service with specific ab test config"
def accountId = PBSUtils.randomNumber
- def ortb2AbTestConfig = AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code, []).tap {
+ def ortb2AbTestConfig = AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code, []).tap {
it.percentActive = MIN_PERCENT_AB
}
def richMediaAbTestConfig = AbTest.getDefault(PB_RESPONSE_CORRECTION.code, [accountId]).tap {
@@ -917,17 +911,17 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for ortb2blocking module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
- and: "PBS should apply ab test config for response-correction module"
+ and: "PBS should apply ab test config for pb-response-correction module"
def responseCorrectionInvocationResults = filterInvocationResultsByModule(invocationResults, PB_RESPONSE_CORRECTION)
verifyAll(responseCorrectionInvocationResults) {
it.status == [SUCCESS]
@@ -938,18 +932,18 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
it.analyticsTags.activities.results.values.module.flatten() == [PB_RESPONSE_CORRECTION]
}
- and: "Metric for skipped ortb2blocking module should be updated based on ab test config"
+ and: "Metric for skipped pb-ortb2blocking module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert !metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
- and: "Metric for skipped response-correction module should be updated based on ab test config"
- assert !metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ and: "Metric for skipped pb-response-correction module should be updated based on ab test config"
+ assert !metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -958,7 +952,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def "PBS shouldn't apply a/b test config from host config for non specified accounts when account config and default account doesn't include a/b test config"() {
given: "PBS service with specific ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code, [PBSUtils.randomNumber]).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code, [PBSUtils.randomNumber]).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -976,7 +970,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for specified module"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION]
@@ -998,20 +992,20 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be as default call"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
and: "Metric for non specified module should be as default call"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -1020,7 +1014,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def "PBS should prioritise a/b test config from default account and only specified module when host and default account contains a/b test configs"() {
given: "PBS service with specific ab test config"
def accountExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -1029,7 +1023,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
}
def hostExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code)]
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code)]
}
def pbsConfig = MULTI_MODULE_CONFIG + ['hooks.host-execution-plan': encode(hostExecutionPlan)] + ["settings.default-account-config": encode(defaultAccountConfigSettings)]
@@ -1046,14 +1040,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
then: "PBS should apply ab test config for specified module and call it based on all execution plans"
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS, SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION, NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING, AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS, FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED, FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "PBS should not apply ab test config for other modules and call them based on all execution plans"
@@ -1067,15 +1061,15 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 2
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 2
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 2
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 2
and: "Metric for non specified module should be as default call"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 2
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 2
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 2
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 2
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -1083,7 +1077,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def "PBS should prioritise a/b test config from account over default account and only specified module when specific account and default account contains a/b test configs"() {
given: "PBS service with specific ab test config"
- def accountExecutionPlan = new ExecutionPlan(abTests: [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code)])
+ def accountExecutionPlan = new ExecutionPlan(abTests: [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code)])
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
hooks = new AccountHooksConfiguration(executionPlan: accountExecutionPlan)
}
@@ -1100,7 +1094,7 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Save account with ab test config"
def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, MODULES_STAGES).tap {
- abTests = [AbTest.getDefault(ModuleName.ORTB2_BLOCKING.code).tap {
+ abTests = [AbTest.getDefault(ModuleName.PB_ORTB2_BLOCKING.code).tap {
percentActive = MIN_PERCENT_AB
}]
}
@@ -1115,14 +1109,14 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
def invocationResults = response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List
and: "PBS should apply ab test config for specified module"
- def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.ORTB2_BLOCKING)
+ def ortbBlockingInvocationResults = filterInvocationResultsByModule(invocationResults, ModuleName.PB_ORTB2_BLOCKING)
verifyAll(ortbBlockingInvocationResults) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_INVOCATION, NO_INVOCATION]
it.analyticsTags.activities.name.flatten() == [AB_TESTING, AB_TESTING].value
it.analyticsTags.activities.status.flatten() == [FetchStatus.SUCCESS, FetchStatus.SUCCESS]
it.analyticsTags.activities.results.status.flatten() == [FetchStatus.SKIPPED, FetchStatus.SKIPPED]
- it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.ORTB2_BLOCKING, ModuleName.ORTB2_BLOCKING]
+ it.analyticsTags.activities.results.values.module.flatten() == [ModuleName.PB_ORTB2_BLOCKING, ModuleName.PB_ORTB2_BLOCKING]
}
and: "PBS should not apply ab test config for other module"
@@ -1136,15 +1130,15 @@ class AbTestingModuleSpec extends ModuleBaseSpec {
and: "Metric for specified module should be updated based on ab test config"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NO_INVOCATION_METRIC.formatted(ModuleName.ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NO_INVOCATION_METRIC(ModuleName.PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "Metric for non specified module should be as default call"
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[CALL_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[CALL_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)] == 1
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NO_INVOCATION_METRIC.formatted(PB_RESPONSE_CORRECTION.code, ALL_PROCESSED_BID_RESPONSES.metricValue, RESPONSE_CORRECTION_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NO_INVOCATION_METRIC(PB_RESPONSE_CORRECTION, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy
index 23316766a7d..b77a36690bb 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/GeneralModuleSpec.groovy
@@ -16,12 +16,9 @@ import org.prebid.server.functional.model.response.auction.InvocationResult
import org.prebid.server.functional.service.PrebidServerService
import org.prebid.server.functional.util.PBSUtils
-import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
+import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.ORTB2_BLOCKING_BIDDER_REQUEST
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.ORTB2_BLOCKING_RAW_BIDDER_RESPONSE
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
import static org.prebid.server.functional.model.config.Stage.BIDDER_REQUEST
import static org.prebid.server.functional.model.config.Stage.RAW_BIDDER_RESPONSE
@@ -31,14 +28,11 @@ import static org.prebid.server.functional.model.response.auction.ResponseAction
class GeneralModuleSpec extends ModuleBaseSpec {
- private final static String CALL_METRIC = "modules.module.%s.stage.%s.hook.%s.call"
- private final static String NOOP_METRIC = "modules.module.%s.stage.%s.hook.%s.success.noop"
-
private final static Map DISABLED_INVOKE_CONFIG = ['settings.modules.require-config-to-invoke': 'false']
private final static Map ENABLED_INVOKE_CONFIG = ['settings.modules.require-config-to-invoke': 'true']
- private final static Map> ORTB_STAGES = [(BIDDER_REQUEST) : [ORTB2_BLOCKING],
- (RAW_BIDDER_RESPONSE): [ORTB2_BLOCKING]]
+ private final static Map> ORTB_STAGES = [(BIDDER_REQUEST) : [PB_ORTB2_BLOCKING],
+ (RAW_BIDDER_RESPONSE): [PB_ORTB2_BLOCKING]]
private final static Map> RESPONSE_STAGES = [(ALL_PROCESSED_BID_RESPONSES): [PB_RICHMEDIA_FILTER]]
private final static Map> MODULES_STAGES = ORTB_STAGES + RESPONSE_STAGES
private final static Map MULTI_MODULE_CONFIG = getRichMediaFilterSettings(PBSUtils.randomString) +
@@ -74,19 +68,19 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING, PB_RICHMEDIA_FILTER].code.sort()
+ it.hookId.moduleCode.sort() == [PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING, PB_RICHMEDIA_FILTER].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModule.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "RB-Richmedia-Filter module call metrics should be updated"
- assert metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
where:
modulesConfig << [null, new PbsModulesConfig()]
@@ -114,19 +108,19 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModule.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "RB-Richmedia-Filter module call metrics should be updated"
- assert metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
where:
pbRichmediaFilterConfig | pbResponseCorrectionConfig
@@ -139,7 +133,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS should call all modules and traces response when default-account includes modules config and require-config-to-invoke is enabled"() {
given: "PBS service with module config"
- def pbsModulesConfig = new PbsModulesConfig(pbRichmediaFilter: new RichmediaFilter(), ortb2Blocking: new Ortb2BlockingConfig())
+ def pbsModulesConfig = new PbsModulesConfig(pbRichmediaFilter: new RichmediaFilter(), pbOrtb2Blocking: new Ortb2BlockingConfig())
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
hooks = new AccountHooksConfiguration(modules: pbsModulesConfig)
}
@@ -162,19 +156,19 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "RB-Richmedia-Filter module call metrics should be updated"
- assert metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -187,7 +181,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
}
and: "Save account with enabled response correction module"
- def pbsModulesConfig = new PbsModulesConfig(pbRichmediaFilter: pbRichmediaFilterConfig, ortb2Blocking: ortb2BlockingConfig)
+ def pbsModulesConfig = new PbsModulesConfig(pbRichmediaFilter: pbRichmediaFilterConfig, pbOrtb2Blocking: ortb2BlockingConfig)
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: pbsModulesConfig))
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
accountDao.save(account)
@@ -202,19 +196,19 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_RICHMEDIA_FILTER, PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "RB-Richmedia-Filter module call metrics should be updated"
- assert metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
where:
pbRichmediaFilterConfig | ortb2BlockingConfig
@@ -252,14 +246,14 @@ class GeneralModuleSpec extends ModuleBaseSpec {
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
and: "RB-Richmedia-Filter module call metrics should be updated"
- assert metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
- assert metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)] == 1
+ assert metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
+ assert metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)] == 1
}
def "PBS shouldn't call any modules and traces that in response when account config is empty and require-config-to-invoke is enabled"() {
@@ -284,14 +278,14 @@ class GeneralModuleSpec extends ModuleBaseSpec {
and: "Ortb2blocking module call metrics shouldn't be updated"
def metrics = pbsServiceWithMultipleModuleWithRequireInvoke.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
and: "RB-Richmedia-Filter module call metrics shouldn't be updated"
- assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
where:
modulesConfig << [null, new PbsModulesConfig()]
@@ -300,7 +294,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS should call all modules without account config when modules enabled in module-execution host config"() {
given: "PBS service with module-execution config"
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG +
- [("hooks.admin.module-execution.${ORTB2_BLOCKING.code}".toString()): 'true']
+ [("hooks.admin.module-execution.${PB_ORTB2_BLOCKING.code}".toString()): 'true']
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
and: "Default bid request with verbose trace"
@@ -318,15 +312,15 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -335,7 +329,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS shouldn't call any module without account config when modules disabled in module-execution host config"() {
given: "PBS service with module-execution config"
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG +
- [("hooks.admin.module-execution.${ORTB2_BLOCKING.code}".toString()): 'false']
+ [("hooks.admin.module-execution.${PB_ORTB2_BLOCKING.code}".toString()): 'false']
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
and: "Default bid request with verbose trace"
@@ -354,10 +348,10 @@ class GeneralModuleSpec extends ModuleBaseSpec {
and: "Ortb2blocking module call metrics shouldn't be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -366,10 +360,10 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS shouldn't call module and not override host config when default-account module-execution config enabled module"() {
given: "PBS service with module-execution and default account configs"
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
- hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true]))
+ hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(PB_ORTB2_BLOCKING): true]))
}
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)] +
- [("hooks.admin.module-execution.${ORTB2_BLOCKING.code}".toString()): 'false']
+ [("hooks.admin.module-execution.${PB_ORTB2_BLOCKING.code}".toString()): 'false']
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
and: "Default bid request with verbose trace"
@@ -393,10 +387,10 @@ class GeneralModuleSpec extends ModuleBaseSpec {
and: "Ortb2blocking module call metrics shouldn't be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -405,7 +399,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS should call module without account module config when default-account module-execution config enabling module"() {
given: "PBS service with module-execution and default account configs"
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
- hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true]))
+ hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(PB_ORTB2_BLOCKING): true]))
}
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)]
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
@@ -430,15 +424,15 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -447,7 +441,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS shouldn't call any modules without account config when default-account module-execution config not enabling module"() {
given: "PBS service with module-execution and default account configs"
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
- hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): moduleExecutionStatus]))
+ hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(PB_ORTB2_BLOCKING): moduleExecutionStatus]))
}
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)]
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
@@ -473,14 +467,14 @@ class GeneralModuleSpec extends ModuleBaseSpec {
and: "Ortb2blocking module call metrics shouldn't be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)]
- assert !metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)]
+ assert !metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)]
and: "RB-Richmedia-Filter module call metrics shouldn't be updated"
- assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
@@ -492,7 +486,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
def "PBS should prioritize specific account module-execution config over default-account module-execution config when both are present"() {
given: "PBS service with default account config"
def defaultAccountConfigSettings = AccountConfig.defaultAccountConfig.tap {
- hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): false]))
+ hooks = new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(PB_ORTB2_BLOCKING): false]))
}
def pbsConfig = MULTI_MODULE_CONFIG + ENABLED_INVOKE_CONFIG + ["settings.default-account-config": encode(defaultAccountConfigSettings)]
def pbsServiceWithMultipleModules = pbsServiceFactory.getService(pbsConfig)
@@ -503,7 +497,7 @@ class GeneralModuleSpec extends ModuleBaseSpec {
}
and: "Save account without modules config"
- def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(ORTB2_BLOCKING): true])))
+ def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(admin: new AdminConfig(moduleExecution: [(PB_ORTB2_BLOCKING): true])))
def account = new Account(uuid: bidRequest.getAccountId(), config: accountConfig)
accountDao.save(account)
@@ -517,19 +511,19 @@ class GeneralModuleSpec extends ModuleBaseSpec {
verifyAll(response?.ext?.prebid?.modules?.trace?.stages?.outcomes?.groups?.invocationResults?.flatten() as List) {
it.status == [SUCCESS, SUCCESS]
it.action == [NO_ACTION, NO_ACTION]
- it.hookId.moduleCode.sort() == [ORTB2_BLOCKING, ORTB2_BLOCKING].code.sort()
+ it.hookId.moduleCode.sort() == [PB_ORTB2_BLOCKING, PB_ORTB2_BLOCKING].code.sort()
}
and: "Ortb2blocking module call metrics should be updated"
def metrics = pbsServiceWithMultipleModules.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[CALL_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, BIDDER_REQUEST.metricValue, ORTB2_BLOCKING_BIDDER_REQUEST.code)] == 1
- assert metrics[NOOP_METRIC.formatted(ORTB2_BLOCKING.code, RAW_BIDDER_RESPONSE.metricValue, ORTB2_BLOCKING_RAW_BIDDER_RESPONSE.code)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[CALL_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, BIDDER_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_ORTB2_BLOCKING, RAW_BIDDER_RESPONSE)] == 1
and: "RB-Richmedia-Filter module call metrics shouldn't be updated"
- assert !metrics[CALL_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
- assert !metrics[NOOP_METRIC.formatted(PB_RICHMEDIA_FILTER.code, ALL_PROCESSED_BID_RESPONSES.metricValue, PB_RICHMEDIA_FILTER_ALL_PROCESSED_RESPONSES.code)]
+ assert !metrics[CALL_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
+ assert !metrics[NOOP_METRIC(PB_RICHMEDIA_FILTER, ALL_PROCESSED_BID_RESPONSES)]
cleanup: "Stop and remove pbs container"
pbsServiceFactory.removeContainer(pbsConfig)
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy
index c0933a238e7..03188ab7027 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/ModuleBaseSpec.groovy
@@ -1,19 +1,19 @@
package org.prebid.server.functional.tests.module
+import org.prebid.server.functional.model.ModuleName
import org.prebid.server.functional.model.config.Endpoint
import org.prebid.server.functional.model.config.ExecutionPlan
import org.prebid.server.functional.model.config.Stage
import org.prebid.server.functional.model.response.auction.AnalyticResult
import org.prebid.server.functional.model.response.auction.BidResponse
-import org.prebid.server.functional.model.response.auction.InvocationResult
import org.prebid.server.functional.tests.BaseSpec
import org.prebid.server.functional.util.PBSUtils
import static org.prebid.server.functional.model.ModuleName.OPTABLE_TARGETING
-import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
+import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
+import static org.prebid.server.functional.model.ModuleName.PB_REQUEST_CORRECTION
import static org.prebid.server.functional.model.ModuleName.PB_RESPONSE_CORRECTION
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
-import static org.prebid.server.functional.model.ModuleName.PB_REQUEST_CORRECTION
import static org.prebid.server.functional.model.ModuleName.PB_RULE_ENGINE
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
@@ -33,6 +33,22 @@ class ModuleBaseSpec extends BaseSpec {
repository.removeAllDatabaseData()
}
+ protected final static Closure CALL_METRIC = { ModuleName module, Stage stage ->
+ "modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.call"
+ }
+ protected final static Closure UPDATE_METRIC = { ModuleName module, Stage stage ->
+ "modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.update"
+ }
+ protected final static Closure NOOP_METRIC = { ModuleName module, Stage stage ->
+ "modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.noop"
+ }
+ protected final static Closure NO_INVOCATION_METRIC = { ModuleName module, Stage stage ->
+ "modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.success.no-invocation"
+ }
+ protected final static Closure EXECUTION_ERROR_METRIC = { ModuleName module, Stage stage ->
+ "modules.module.${module.code}.stage.${stage.metricValue}.hook.${module.code}-${stage.value}-hook.execution-error"
+ }
+
protected static Map getResponseCorrectionConfig(Endpoint endpoint = OPENRTB2_AUCTION) {
["hooks.${PB_RESPONSE_CORRECTION.code}.enabled": true,
"hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(ALL_PROCESSED_BID_RESPONSES): [PB_RESPONSE_CORRECTION]]))]
@@ -60,16 +76,16 @@ class ModuleBaseSpec extends BaseSpec {
}
protected static Map getOptableTargetingSettings(boolean isEnabled = true, Endpoint endpoint = OPENRTB2_AUCTION) {
- ["hooks.${OPTABLE_TARGETING.code}.enabled": isEnabled as String,
- "hooks.modules.${OPTABLE_TARGETING.code}.api-endpoint" : "$networkServiceContainer.rootUri/stored-cache".toString(),
- "hooks.modules.${OPTABLE_TARGETING.code}.tenant" : PBSUtils.randomString,
- "hooks.modules.${OPTABLE_TARGETING.code}.origin" : PBSUtils.randomString,
- "hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(PROCESSED_AUCTION_REQUEST): [OPTABLE_TARGETING]]))]
+ ["hooks.${OPTABLE_TARGETING.code}.enabled" : isEnabled as String,
+ "hooks.modules.${OPTABLE_TARGETING.code}.api-endpoint": "$networkServiceContainer.rootUri/stored-cache".toString(),
+ "hooks.modules.${OPTABLE_TARGETING.code}.tenant" : PBSUtils.randomString,
+ "hooks.modules.${OPTABLE_TARGETING.code}.origin" : PBSUtils.randomString,
+ "hooks.host-execution-plan" : encode(ExecutionPlan.getSingleEndpointExecutionPlan(endpoint, [(PROCESSED_AUCTION_REQUEST): [OPTABLE_TARGETING]]))]
.collectEntries { key, value -> [(key.toString()): value.toString()] }
}
protected static Map getOrtb2BlockingSettings(boolean isEnabled = true) {
- ["hooks.${ORTB2_BLOCKING.code}.enabled": isEnabled as String]
+ ["hooks.${PB_ORTB2_BLOCKING.code}.enabled": isEnabled as String]
}
protected static Map getRequestCorrectionSettings(Endpoint endpoint = OPENRTB2_AUCTION, Stage stage = PROCESSED_AUCTION_REQUEST) {
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy
index 82355a47996..c47eb5d7111 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/analyticstag/AnalyticsTagsModuleSpec.groovy
@@ -19,7 +19,7 @@ import org.prebid.server.functional.service.PrebidServerService
import org.prebid.server.functional.tests.module.ModuleBaseSpec
import org.prebid.server.functional.util.PBSUtils
-import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
+import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
import static org.prebid.server.functional.model.ModuleName.PB_RICHMEDIA_FILTER
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTION
@@ -36,14 +36,14 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
pbsServiceFactory.removeContainer(getOrtb2BlockingSettings())
}
- def "PBS should include analytics tag for ortb2-blocking module in response when request and account allow client details"() {
+ def "PBS should include analytics tag for pb-ortb2-blocking module in response when request and account allow client details"() {
given: "Default account with module config"
def bidRequest = BidRequest.defaultBidRequest.tap {
it.ext.prebid.analytics = new PrebidAnalytics(options: new AnalyticsOptions(enableClientDetails: true))
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -55,7 +55,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
then: "Bid response should contain ext.prebid.analyticsTags with module record"
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
- assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
+ assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
and: "Analytics tag should contain results with name and success status"
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -122,7 +122,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
def "PBS should include analytics tag in response when request and default account allow client details"() {
given: "Default account with module config"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
@@ -141,7 +141,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
then: "Bid response should contain ext.prebid.analyticsTags with module record"
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
- assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
+ assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
and: "Analytics tag should contain results with name and success status"
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -161,7 +161,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
def "PBS should include analytics tag in response when request and account allow client details but default doesn't"() {
given: "Default account with module config"
- def defaultExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def defaultExecutionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def defaultHooksConfiguration = new AccountHooksConfiguration(executionPlan: defaultExecutionPlan)
def defaultAccountConfig = new AccountConfig(hooks: defaultHooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
@@ -175,7 +175,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -187,7 +187,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
then: "Bid response should contain ext.prebid.analyticsTags with module record"
def analyticsTagPrebid = bidResponse.ext.prebid.analytics.tags.first
assert analyticsTagPrebid.stage == RAW_BIDDER_RESPONSE.value
- assert analyticsTagPrebid.module == ORTB2_BLOCKING.code
+ assert analyticsTagPrebid.module == PB_ORTB2_BLOCKING.code
and: "Analytics tag should contain results with name and success status"
def analyticResult = analyticsTagPrebid.analyticsTags.activities.first
@@ -212,7 +212,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -235,7 +235,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: true))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -258,7 +258,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
@@ -282,7 +282,7 @@ class AnalyticsTagsModuleSpec extends ModuleBaseSpec {
}
and: "Account in the DB"
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [RAW_BIDDER_RESPONSE])
def hooksConfiguration = new AccountHooksConfiguration(executionPlan: executionPlan)
def accountConfig = new AccountConfig(hooks: hooksConfiguration, analytics: new AccountAnalyticsConfig(allowClientDetails: false))
def account = new Account(uuid: bidRequest.accountId, config: accountConfig)
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/ortb2blocking/Ortb2BlockingSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbortb2blocking/PbOrtb2BlockingSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/ortb2blocking/Ortb2BlockingSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbortb2blocking/PbOrtb2BlockingSpec.groovy
index a7a97bc8816..4c48f506643 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/ortb2blocking/Ortb2BlockingSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbortb2blocking/PbOrtb2BlockingSpec.groovy
@@ -1,4 +1,4 @@
-package org.prebid.server.functional.tests.module.ortb2blocking
+package org.prebid.server.functional.tests.module.pbortb2blocking
import org.prebid.server.functional.model.bidder.BidderName
import org.prebid.server.functional.model.bidder.Generic
@@ -27,14 +27,13 @@ import org.prebid.server.functional.model.response.auction.Adm
import org.prebid.server.functional.model.response.auction.Bid
import org.prebid.server.functional.model.response.auction.BidMediaType
import org.prebid.server.functional.model.response.auction.BidResponse
-import org.prebid.server.functional.model.response.auction.ErrorType
import org.prebid.server.functional.model.response.auction.MediaType
import org.prebid.server.functional.model.response.auction.SeatBid
import org.prebid.server.functional.service.PrebidServerService
import org.prebid.server.functional.tests.module.ModuleBaseSpec
import org.prebid.server.functional.util.PBSUtils
-import static org.prebid.server.functional.model.ModuleName.ORTB2_BLOCKING
+import static org.prebid.server.functional.model.ModuleName.PB_ORTB2_BLOCKING
import static org.prebid.server.functional.model.bidder.BidderName.ALIAS
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
import static org.prebid.server.functional.model.bidder.BidderName.IX
@@ -54,7 +53,7 @@ import static org.prebid.server.functional.model.response.auction.MediaType.BANN
import static org.prebid.server.functional.model.response.auction.MediaType.VIDEO
import static org.prebid.server.functional.testcontainers.Dependencies.getNetworkServiceContainer
-class Ortb2BlockingSpec extends ModuleBaseSpec {
+class PbOrtb2BlockingSpec extends ModuleBaseSpec {
private static final String WILDCARD = '*'
private static final Map IX_CONFIG = ["adapters.ix.enabled" : "true",
@@ -285,7 +284,7 @@ class Ortb2BlockingSpec extends ModuleBaseSpec {
def response = pbsServiceWithEnabledOrtb2Blocking.sendAuctionRequest(bidRequest)
then: "PBS response should contain seatNonBid for the called bidder"
- assert response.ext.prebid.modules.errors.ortb2Blocking["ortb2-blocking-bidder-request"].first
+ assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
.contains("field in account configuration is not an array")
and: "PBS response shouldn't contain any module warning"
@@ -318,7 +317,7 @@ class Ortb2BlockingSpec extends ModuleBaseSpec {
def response = pbsServiceWithEnabledOrtb2Blocking.sendAuctionRequest(bidRequest)
then: "PBS response should contain seatNonBid for the called bidder"
- assert response.ext.prebid.modules.errors.ortb2Blocking["ortb2-blocking-bidder-request"].first
+ assert response.ext.prebid.modules.errors.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"].first
.contains("field in account configuration has unexpected type")
and: "PBS response shouldn't contain any module warning"
@@ -1309,7 +1308,7 @@ class Ortb2BlockingSpec extends ModuleBaseSpec {
assert !response?.ext?.prebid?.modules?.errors
and: "PBS response should contain proper warning"
- assert response?.ext?.prebid?.modules?.warnings?.ortb2Blocking["ortb2-blocking-bidder-request"] ==
+ assert response?.ext?.prebid?.modules?.warnings?.pbOrtb2Blocking["${PB_ORTB2_BLOCKING.code}-${BIDDER_REQUEST.value}-hook"] ==
["More than one conditions matches request. Bidder: generic, request media types: [${bidRequest.imp[0].mediaTypes[0].value}]"]
where:
@@ -1532,8 +1531,8 @@ class Ortb2BlockingSpec extends ModuleBaseSpec {
private static Account getAccountWithOrtb2BlockingConfig(String accountId, Map attributes) {
def blockingConfig = new Ortb2BlockingConfig(attributes: attributes)
- def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, ORTB2_BLOCKING, [BIDDER_REQUEST, RAW_BIDDER_RESPONSE])
- def moduleConfig = new PbsModulesConfig(ortb2Blocking: blockingConfig)
+ def executionPlan = ExecutionPlan.getSingleEndpointExecutionPlan(OPENRTB2_AUCTION, PB_ORTB2_BLOCKING, [BIDDER_REQUEST, RAW_BIDDER_RESPONSE])
+ def moduleConfig = new PbsModulesConfig(pbOrtb2Blocking: blockingConfig)
def accountHooksConfig = new AccountHooksConfiguration(executionPlan: executionPlan, modules: moduleConfig)
def accountConfig = new AccountConfig(hooks: accountHooksConfig)
new Account(uuid: accountId, config: accountConfig)
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/responsecorrenction/ResponseCorrectionSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbresponsecorrenction/PbResponseCorrectionSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/responsecorrenction/ResponseCorrectionSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbresponsecorrenction/PbResponseCorrectionSpec.groovy
index 2426a3fd316..1ac91fd7272 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/responsecorrenction/ResponseCorrectionSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbresponsecorrenction/PbResponseCorrectionSpec.groovy
@@ -1,4 +1,4 @@
-package org.prebid.server.functional.tests.module.responsecorrenction
+package org.prebid.server.functional.tests.module.pbresponsecorrenction
import org.prebid.server.functional.model.config.AccountAuctionConfig
import org.prebid.server.functional.model.config.AccountCacheConfig
@@ -32,7 +32,7 @@ import static org.prebid.server.functional.model.response.auction.MediaType.BANN
import static org.prebid.server.functional.model.response.auction.MediaType.NATIVE
import static org.prebid.server.functional.model.response.auction.MediaType.VIDEO
-class ResponseCorrectionSpec extends ModuleBaseSpec {
+class PbResponseCorrectionSpec extends ModuleBaseSpec {
private final static int OPTIMAL_MAX_LENGTH = 20
private static final Map PBS_CONFIG = ["adapter-defaults.modifying-vast-xml-allowed": "false",
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/richmedia/RichMediaFilterSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbrichmedia/PbRichMediaFilterSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/richmedia/RichMediaFilterSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbrichmedia/PbRichMediaFilterSpec.groovy
index 517da393668..7c6fbbafac7 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/richmedia/RichMediaFilterSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbrichmedia/PbRichMediaFilterSpec.groovy
@@ -1,4 +1,4 @@
-package org.prebid.server.functional.tests.module.richmedia
+package org.prebid.server.functional.tests.module.pbrichmedia
import org.prebid.server.functional.model.config.AccountConfig
import org.prebid.server.functional.model.config.AccountHooksConfiguration
@@ -23,7 +23,7 @@ import static org.prebid.server.functional.model.config.Endpoint.OPENRTB2_AUCTIO
import static org.prebid.server.functional.model.config.Stage.ALL_PROCESSED_BID_RESPONSES
import static org.prebid.server.functional.model.request.auction.TraceLevel.VERBOSE
-class RichMediaFilterSpec extends ModuleBaseSpec {
+class PbRichMediaFilterSpec extends ModuleBaseSpec {
private static final String PATTERN_NAME = PBSUtils.randomString
private static final String PATTERN_NAME_ACCOUNT = PBSUtils.randomString
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineAliasSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineAliasSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineAliasSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineAliasSpec.groovy
index 4477e6d9d38..63e41a14c55 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineAliasSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineAliasSpec.groovy
@@ -14,7 +14,7 @@ import static org.prebid.server.functional.model.config.RuleEngineModelRuleResul
import static org.prebid.server.functional.model.request.auction.FetchStatus.SUCCESS
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineAliasSpec extends RuleEngineBaseSpec {
+class PbRuleEngineAliasSpec extends PbRuleEngineBaseSpec {
def "PBS should leave only hard alias bidder at imps when hard alias bidder include in account config"() {
given: "Bid request with multiply imps bidders"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineBaseSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy
similarity index 91%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineBaseSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy
index d27d44e0fc0..54665fefe81 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineBaseSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineBaseSpec.groovy
@@ -21,14 +21,11 @@ import org.prebid.server.functional.tests.module.ModuleBaseSpec
import org.prebid.server.functional.util.PBSUtils
import spock.lang.Retry
-import static org.prebid.server.functional.model.ModuleName.PB_RULE_ENGINE
import static org.prebid.server.functional.model.bidder.BidderName.ALIAS
import static org.prebid.server.functional.model.bidder.BidderName.AMX
import static org.prebid.server.functional.model.bidder.BidderName.GENERIC
import static org.prebid.server.functional.model.bidder.BidderName.OPENX
import static org.prebid.server.functional.model.bidder.BidderName.OPENX_ALIAS
-import static org.prebid.server.functional.model.config.ModuleHookImplementation.PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST
-import static org.prebid.server.functional.model.config.Stage.PROCESSED_AUCTION_REQUEST
import static org.prebid.server.functional.model.pricefloors.Country.USA
import static org.prebid.server.functional.model.request.auction.DistributionChannel.APP
import static org.prebid.server.functional.model.request.auction.DistributionChannel.DOOH
@@ -42,14 +39,11 @@ import static org.prebid.server.functional.testcontainers.Dependencies.getNetwor
import static org.prebid.server.functional.util.privacy.TcfConsent.GENERIC_VENDOR_ID
@Retry //TODO remove in 3.34+
-abstract class RuleEngineBaseSpec extends ModuleBaseSpec {
+abstract class PbRuleEngineBaseSpec extends ModuleBaseSpec {
protected static final List MULTI_BID_ADAPTERS = [GENERIC, OPENX, AMX].sort()
protected static final String APPLIED_FOR_ALL_IMPS = "*"
protected static final String DEFAULT_CONDITIONS = "default"
- protected final static String CALL_METRIC = "modules.module.${PB_RULE_ENGINE.code}.stage.${PROCESSED_AUCTION_REQUEST.metricValue}.hook.${PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST.code}.call"
- protected final static String NOOP_METRIC = "modules.module.${PB_RULE_ENGINE.code}.stage.${PROCESSED_AUCTION_REQUEST.metricValue}.hook.${PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST.code}.success.noop"
- protected final static String UPDATE_METRIC = "modules.module.${PB_RULE_ENGINE.code}.stage.${PROCESSED_AUCTION_REQUEST.metricValue}.hook.${PB_RULES_ENGINE_PROCESSED_AUCTION_REQUEST.code}.success.update"
protected final static Closure INVALID_CONFIGURATION_FOR_STRINGS_LOG_WARNING = { accountId, functionType ->
"Failed to parse rule-engine config for account $accountId: " +
"Function '$functionType' configuration is invalid: " +
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineContextSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineContextSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineContextSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineContextSpec.groovy
index 5bea040218e..54088cbdf9c 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineContextSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineContextSpec.groovy
@@ -40,7 +40,7 @@ import static org.prebid.server.functional.model.request.auction.ImpUnitCode.STO
import static org.prebid.server.functional.model.request.auction.ImpUnitCode.TAG_ID
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineContextSpec extends RuleEngineBaseSpec {
+class PbRuleEngineContextSpec extends PbRuleEngineBaseSpec {
def "PBS should exclude bidder when channel match with condition"() {
given: "Bid request with multiply bidders"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineCoreSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineCoreSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineCoreSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineCoreSpec.groovy
index 8e9de1807c9..2313116c907 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineCoreSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineCoreSpec.groovy
@@ -1,5 +1,6 @@
package org.prebid.server.functional.tests.module.pbruleengine
+
import org.prebid.server.functional.model.config.RuleEngineModelDefault
import org.prebid.server.functional.model.config.RuleEngineModelDefaultArgs
import org.prebid.server.functional.model.config.RuleSet
@@ -25,7 +26,7 @@ import static org.prebid.server.functional.model.request.auction.TraceLevel.VERB
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.ERROR_NO_BID
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineCoreSpec extends RuleEngineBaseSpec {
+class PbRuleEngineCoreSpec extends PbRuleEngineBaseSpec {
def "PBS should remove bidder and not update analytics when bidder matched with conditions and without analytics key"() {
given: "Bid request with multiply bidders"
@@ -64,8 +65,8 @@ class RuleEngineCoreSpec extends RuleEngineBaseSpec {
and: "PBs should populate call and update metrics"
def metrics = pbsServiceWithRulesEngineModule.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC] == 1
- assert metrics[UPDATE_METRIC] == 1
+ assert metrics[CALL_METRIC(PB_RULE_ENGINE, PROCESSED_AUCTION_REQUEST)] == 1
+ assert metrics[UPDATE_METRIC(PB_RULE_ENGINE, PROCESSED_AUCTION_REQUEST)] == 1
and: "Response should seatNon bid with code 203"
assert bidResponse.ext.seatnonbid.size() == 1
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineDeviceSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineDeviceSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineDeviceSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineDeviceSpec.groovy
index 229e54a0ff0..6c32f351ea5 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineDeviceSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineDeviceSpec.groovy
@@ -6,7 +6,6 @@ import org.prebid.server.functional.model.pricefloors.Country
import org.prebid.server.functional.model.request.auction.Device
import org.prebid.server.functional.model.request.auction.DeviceType
import org.prebid.server.functional.util.PBSUtils
-import spock.lang.RepeatUntilFailure
import java.time.Instant
@@ -23,7 +22,7 @@ import static org.prebid.server.functional.model.pricefloors.Country.USA
import static org.prebid.server.functional.model.request.auction.FetchStatus.SUCCESS
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineDeviceSpec extends RuleEngineBaseSpec {
+class PbRuleEngineDeviceSpec extends PbRuleEngineBaseSpec {
def "PBS should exclude bidder when deviceCountry match with condition"() {
given: "Bid request with multiply bidders"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineInfrastructureSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineInfrastructureSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineInfrastructureSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineInfrastructureSpec.groovy
index f710ba39f93..b77fd82964c 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineInfrastructureSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineInfrastructureSpec.groovy
@@ -16,7 +16,7 @@ import static org.prebid.server.functional.model.config.RuleEngineFunction.DATA_
import static org.prebid.server.functional.model.request.auction.FetchStatus.SUCCESS
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineInfrastructureSpec extends RuleEngineBaseSpec {
+class PbRuleEngineInfrastructureSpec extends PbRuleEngineBaseSpec {
def "PBS should reject processing rule engine when dataCenterIn schema function args contain invalid data"() {
given: "Test start time"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEnginePrivacySpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEnginePrivacySpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEnginePrivacySpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEnginePrivacySpec.groovy
index c4f207544b5..b169407ced3 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEnginePrivacySpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEnginePrivacySpec.groovy
@@ -37,7 +37,7 @@ import static org.prebid.server.functional.model.response.auction.BidRejectionRe
import static org.prebid.server.functional.util.privacy.TcfConsent.GENERIC_VENDOR_ID
import static org.prebid.server.functional.util.privacy.TcfConsent.PurposeId.BASIC_ADS
-class RuleEnginePrivacySpec extends RuleEngineBaseSpec {
+class PbRuleEnginePrivacySpec extends PbRuleEngineBaseSpec {
def "PBS should exclude bidder when eidAvailable match with condition"() {
given: "Bid request with multiply bidders"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSpecialSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSpecialSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSpecialSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSpecialSpec.groovy
index cce9631e1b9..06c1f6b2a93 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSpecialSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSpecialSpec.groovy
@@ -15,7 +15,7 @@ import static org.prebid.server.functional.model.config.RuleEngineFunction.PREBI
import static org.prebid.server.functional.model.request.auction.FetchStatus.SUCCESS
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineSpecialSpec extends RuleEngineBaseSpec {
+class PbRuleEngineSpecialSpec extends PbRuleEngineBaseSpec {
def "PBS should reject processing rule engine when percent schema function args contain invalid data"() {
given: "Test start time"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSyncSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSyncSpec.groovy
similarity index 99%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSyncSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSyncSpec.groovy
index 881a8211ca4..8afcc8d4404 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineSyncSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineSyncSpec.groovy
@@ -13,7 +13,7 @@ import static org.prebid.server.functional.model.config.RuleEngineModelRuleResul
import static org.prebid.server.functional.model.request.auction.FetchStatus.SUCCESS
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.REQUEST_BIDDER_REMOVED_BY_RULE_ENGINE_MODULE
-class RuleEngineSyncSpec extends RuleEngineBaseSpec {
+class PbRuleEngineSyncSpec extends PbRuleEngineBaseSpec {
def "PBS should remove bidder from imps when bidder has ID in the uids cookie and bidder excluded and ifSyncedId=true in account config"() {
given: "Bid request with multiply bidders"
diff --git a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineValidationSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineValidationSpec.groovy
similarity index 96%
rename from src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineValidationSpec.groovy
rename to src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineValidationSpec.groovy
index dbf7395c1f0..59ec10955de 100644
--- a/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/RuleEngineValidationSpec.groovy
+++ b/src/test/groovy/org/prebid/server/functional/tests/module/pbruleengine/PbRuleEngineValidationSpec.groovy
@@ -5,6 +5,7 @@ import org.prebid.server.functional.util.PBSUtils
import java.time.Instant
+import static org.prebid.server.functional.model.ModuleName.PB_RULE_ENGINE
import static org.prebid.server.functional.model.config.PbRulesEngine.createRulesEngineWithRule
import static org.prebid.server.functional.model.config.RuleEngineFunction.AD_UNIT_CODE
import static org.prebid.server.functional.model.config.RuleEngineFunction.BUNDLE
@@ -17,9 +18,10 @@ import static org.prebid.server.functional.model.config.RuleEngineFunction.FPD_A
import static org.prebid.server.functional.model.config.RuleEngineFunction.GPP_SID_AVAILABLE
import static org.prebid.server.functional.model.config.RuleEngineFunction.TCF_IN_SCOPE
import static org.prebid.server.functional.model.config.RuleEngineFunction.USER_FPD_AVAILABLE
+import static org.prebid.server.functional.model.config.Stage.PROCESSED_AUCTION_REQUEST
import static org.prebid.server.functional.model.pricefloors.Country.BULGARIA
-class RuleEngineValidationSpec extends RuleEngineBaseSpec {
+class PbRuleEngineValidationSpec extends PbRuleEngineBaseSpec {
def "PBS shouldn't remove bidder when rule engine not fully configured in account"() {
given: "Bid request with multiply bidders"
@@ -58,11 +60,11 @@ class RuleEngineValidationSpec extends RuleEngineBaseSpec {
and: "PBs should populate call and noop metrics"
def metrics = pbsServiceWithRulesEngineModule.sendCollectedMetricsRequest()
- assert metrics[CALL_METRIC] == 1
- assert metrics[NOOP_METRIC] == 1
+ assert metrics[CALL_METRIC(PB_RULE_ENGINE, PROCESSED_AUCTION_REQUEST)] == 1
+ assert metrics[NOOP_METRIC(PB_RULE_ENGINE,PROCESSED_AUCTION_REQUEST)] == 1
and: "PBs should populate update metrics"
- assert !metrics[UPDATE_METRIC]
+ assert !metrics[UPDATE_METRIC(PB_RULE_ENGINE,PROCESSED_AUCTION_REQUEST)]
where:
pbRulesEngine << [
@@ -112,7 +114,7 @@ class RuleEngineValidationSpec extends RuleEngineBaseSpec {
and: "PBs should populate noop metrics"
def metrics = pbsServiceWithRulesEngineModule.sendCollectedMetricsRequest()
- assert metrics[NOOP_METRIC] == 1
+ assert metrics[NOOP_METRIC(PB_RULE_ENGINE,PROCESSED_AUCTION_REQUEST)] == 1
}
def "PBS shouldn't remove bidder and emit a warning when args rule engine not fully configured in account"() {
@@ -150,7 +152,7 @@ class RuleEngineValidationSpec extends RuleEngineBaseSpec {
and: "PBs should populate failer metrics"
def metrics = pbsServiceWithRulesEngineModule.sendCollectedMetricsRequest()
- assert metrics[NOOP_METRIC] == 1
+ assert metrics[NOOP_METRIC(PB_RULE_ENGINE,PROCESSED_AUCTION_REQUEST)] == 1
}
def "PBS shouldn't remove bidder and emit a warning when model group rule engine not fully configured in account"() {