diff --git a/src/test/java/org/prebid/server/auction/HooksMetricsServiceTest.java b/src/test/java/org/prebid/server/auction/HooksMetricsServiceTest.java index 608cb7a2350..4d90cc637d7 100644 --- a/src/test/java/org/prebid/server/auction/HooksMetricsServiceTest.java +++ b/src/test/java/org/prebid/server/auction/HooksMetricsServiceTest.java @@ -16,10 +16,10 @@ import org.prebid.server.hooks.execution.model.HookId; import org.prebid.server.hooks.execution.model.Stage; import org.prebid.server.hooks.execution.model.StageExecutionOutcome; -import org.prebid.server.hooks.v1.analytics.ActivityImpl; -import org.prebid.server.hooks.v1.analytics.AppliedToImpl; -import org.prebid.server.hooks.v1.analytics.ResultImpl; -import org.prebid.server.hooks.v1.analytics.TagsImpl; +import org.prebid.server.hooks.execution.v1.analytics.ActivityImpl; +import org.prebid.server.hooks.execution.v1.analytics.AppliedToImpl; +import org.prebid.server.hooks.execution.v1.analytics.ResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.TagsImpl; import org.prebid.server.metric.Metrics; import org.prebid.server.model.Endpoint; import org.prebid.server.settings.model.Account; diff --git a/src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java b/src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java index 1c0afa05611..aee1397e4c9 100644 --- a/src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java +++ b/src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java @@ -52,11 +52,11 @@ import org.prebid.server.hooks.execution.model.HookStageExecutionResult; import org.prebid.server.hooks.execution.model.Stage; import org.prebid.server.hooks.execution.model.StageExecutionOutcome; +import org.prebid.server.hooks.execution.v1.analytics.ActivityImpl; +import org.prebid.server.hooks.execution.v1.analytics.AppliedToImpl; +import org.prebid.server.hooks.execution.v1.analytics.ResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.TagsImpl; import org.prebid.server.hooks.execution.v1.exitpoint.ExitpointPayloadImpl; -import org.prebid.server.hooks.v1.analytics.ActivityImpl; -import org.prebid.server.hooks.v1.analytics.AppliedToImpl; -import org.prebid.server.hooks.v1.analytics.ResultImpl; -import org.prebid.server.hooks.v1.analytics.TagsImpl; import org.prebid.server.log.HttpInteractionLogger; import org.prebid.server.metric.MetricName; import org.prebid.server.metric.Metrics; diff --git a/src/test/java/org/prebid/server/handler/openrtb2/AuctionHandlerTest.java b/src/test/java/org/prebid/server/handler/openrtb2/AuctionHandlerTest.java index 23a50d17fdb..1618caea8d2 100644 --- a/src/test/java/org/prebid/server/handler/openrtb2/AuctionHandlerTest.java +++ b/src/test/java/org/prebid/server/handler/openrtb2/AuctionHandlerTest.java @@ -46,11 +46,11 @@ import org.prebid.server.hooks.execution.model.HookStageExecutionResult; import org.prebid.server.hooks.execution.model.Stage; import org.prebid.server.hooks.execution.model.StageExecutionOutcome; +import org.prebid.server.hooks.execution.v1.analytics.ActivityImpl; +import org.prebid.server.hooks.execution.v1.analytics.AppliedToImpl; +import org.prebid.server.hooks.execution.v1.analytics.ResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.TagsImpl; import org.prebid.server.hooks.execution.v1.exitpoint.ExitpointPayloadImpl; -import org.prebid.server.hooks.v1.analytics.ActivityImpl; -import org.prebid.server.hooks.v1.analytics.AppliedToImpl; -import org.prebid.server.hooks.v1.analytics.ResultImpl; -import org.prebid.server.hooks.v1.analytics.TagsImpl; import org.prebid.server.log.HttpInteractionLogger; import org.prebid.server.metric.MetricName; import org.prebid.server.metric.Metrics; diff --git a/src/test/java/org/prebid/server/hooks/execution/HookStageExecutorTest.java b/src/test/java/org/prebid/server/hooks/execution/HookStageExecutorTest.java index c437be84086..ea9ad000891 100644 --- a/src/test/java/org/prebid/server/hooks/execution/HookStageExecutorTest.java +++ b/src/test/java/org/prebid/server/hooks/execution/HookStageExecutorTest.java @@ -2961,7 +2961,7 @@ public void shouldExecuteExitpointHooksAndPassAuctionInvocationContext(VertxTest // given final ExitpointHookImpl hookImpl = spy( ExitpointHookImpl.of(immediateHook(InvocationResultUtils.succeeded(identity())))); - given(hookCatalog.hookById(eq("module-alpha"), eq("hook-a"), eq(StageWithHookType.EXITPOINT))) + given(hookCatalog.hookById(eqHook("module-alpha", "hook-a"), eq(StageWithHookType.EXITPOINT))) .willReturn(hookImpl); final HookStageExecutor executor = createExecutor( @@ -2980,7 +2980,7 @@ public void shouldExecuteExitpointHooksAndPassAuctionInvocationContext(VertxTest .bidRequest(BidRequest.builder().build()) .account(Account.builder() .hooks(AccountHooksConfiguration.of( - null, singletonMap("module-alpha", mapper.createObjectNode()))) + null, singletonMap("module-alpha", mapper.createObjectNode()), null)) .build()) .hookExecutionContext(hookExecutionContext) .debugContext(DebugContext.empty()) @@ -3257,28 +3257,16 @@ private void givenAuctionResponseHook( .willReturn(AuctionResponseHookImpl.of(delegate)); } - @Value(staticConstructor = "of") - @NonFinal - private static class ExitpointHookImpl implements ExitpointHook { - - String code = "hook-code"; - - BiFunction< - ExitpointPayload, - AuctionInvocationContext, - Future>> delegate; - - @Override - public Future> call(ExitpointPayload payload, - AuctionInvocationContext invocationContext) { - - return delegate.apply(payload, invocationContext); - } + private void givenExitpointHook( + String moduleCode, + String hookImplCode, + BiFunction< + ExitpointPayload, + AuctionInvocationContext, + Future>> delegate) { - @Override - public String code() { - return code; - } + given(hookCatalog.hookById(eqHook(moduleCode, hookImplCode), eq(StageWithHookType.EXITPOINT))) + .willReturn(ExitpointHookImpl.of(delegate)); } private BiFunction>> delayedHook( @@ -3508,15 +3496,27 @@ public String code() { } } - private void givenExitpointHook( - String moduleCode, - String hookImplCode, - BiFunction< - ExitpointPayload, - AuctionInvocationContext, - Future>> delegate) { + @Value(staticConstructor = "of") + @NonFinal + private static class ExitpointHookImpl implements ExitpointHook { - given(hookCatalog.hookById(eq(moduleCode), eq(hookImplCode), eq(StageWithHookType.EXITPOINT))) - .willReturn(ExitpointHookImpl.of(delegate)); + String code = "hook-code"; + + BiFunction< + ExitpointPayload, + AuctionInvocationContext, + Future>> delegate; + + @Override + public Future> call(ExitpointPayload payload, + AuctionInvocationContext invocationContext) { + + return delegate.apply(payload, invocationContext); + } + + @Override + public String code() { + return code; + } } } diff --git a/src/test/java/org/prebid/server/it/hooks/HooksTest.java b/src/test/java/org/prebid/server/it/hooks/HooksTest.java index d41adb6ba80..902f12c6589 100644 --- a/src/test/java/org/prebid/server/it/hooks/HooksTest.java +++ b/src/test/java/org/prebid/server/it/hooks/HooksTest.java @@ -12,10 +12,10 @@ import org.prebid.server.hooks.execution.model.HookExecutionOutcome; import org.prebid.server.hooks.execution.model.Stage; import org.prebid.server.hooks.execution.model.StageExecutionOutcome; -import org.prebid.server.hooks.v1.analytics.ActivityImpl; -import org.prebid.server.hooks.v1.analytics.AppliedToImpl; -import org.prebid.server.hooks.v1.analytics.ResultImpl; -import org.prebid.server.hooks.v1.analytics.TagsImpl; +import org.prebid.server.hooks.execution.v1.analytics.ActivityImpl; +import org.prebid.server.hooks.execution.v1.analytics.AppliedToImpl; +import org.prebid.server.hooks.execution.v1.analytics.ResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.TagsImpl; import org.prebid.server.it.IntegrationTest; import org.prebid.server.version.PrebidVersionProvider; import org.skyscreamer.jsonassert.JSONAssert; diff --git a/src/test/java/org/prebid/server/it/hooks/SampleItExitpointHook.java b/src/test/java/org/prebid/server/it/hooks/SampleItExitpointHook.java index e12b4a6c132..82a494e7158 100644 --- a/src/test/java/org/prebid/server/it/hooks/SampleItExitpointHook.java +++ b/src/test/java/org/prebid/server/it/hooks/SampleItExitpointHook.java @@ -3,15 +3,15 @@ import com.iab.openrtb.response.BidResponse; import com.iab.openrtb.response.SeatBid; import io.vertx.core.Future; +import org.prebid.server.hooks.execution.v1.InvocationResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.ActivityImpl; +import org.prebid.server.hooks.execution.v1.analytics.AppliedToImpl; +import org.prebid.server.hooks.execution.v1.analytics.ResultImpl; +import org.prebid.server.hooks.execution.v1.analytics.TagsImpl; import org.prebid.server.hooks.execution.v1.exitpoint.ExitpointPayloadImpl; import org.prebid.server.hooks.v1.InvocationAction; import org.prebid.server.hooks.v1.InvocationResult; -import org.prebid.server.hooks.v1.InvocationResultImpl; import org.prebid.server.hooks.v1.InvocationStatus; -import org.prebid.server.hooks.v1.analytics.ActivityImpl; -import org.prebid.server.hooks.v1.analytics.AppliedToImpl; -import org.prebid.server.hooks.v1.analytics.ResultImpl; -import org.prebid.server.hooks.v1.analytics.TagsImpl; import org.prebid.server.hooks.v1.auction.AuctionInvocationContext; import org.prebid.server.hooks.v1.exitpoint.ExitpointHook; import org.prebid.server.hooks.v1.exitpoint.ExitpointPayload;