Skip to content

Commit

Permalink
Fix merge issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
CTMBNara committed Dec 4, 2024
1 parent 4fa3dbe commit ca64df6
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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())
Expand Down Expand Up @@ -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<InvocationResult<ExitpointPayload>>> delegate;

@Override
public Future<InvocationResult<ExitpointPayload>> call(ExitpointPayload payload,
AuctionInvocationContext invocationContext) {

return delegate.apply(payload, invocationContext);
}
private void givenExitpointHook(
String moduleCode,
String hookImplCode,
BiFunction<
ExitpointPayload,
AuctionInvocationContext,
Future<InvocationResult<ExitpointPayload>>> delegate) {

@Override
public String code() {
return code;
}
given(hookCatalog.hookById(eqHook(moduleCode, hookImplCode), eq(StageWithHookType.EXITPOINT)))
.willReturn(ExitpointHookImpl.of(delegate));
}

private <PAYLOAD, CONTEXT> BiFunction<PAYLOAD, CONTEXT, Future<InvocationResult<PAYLOAD>>> delayedHook(
Expand Down Expand Up @@ -3508,15 +3496,27 @@ public String code() {
}
}

private void givenExitpointHook(
String moduleCode,
String hookImplCode,
BiFunction<
ExitpointPayload,
AuctionInvocationContext,
Future<InvocationResult<ExitpointPayload>>> 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<InvocationResult<ExitpointPayload>>> delegate;

@Override
public Future<InvocationResult<ExitpointPayload>> call(ExitpointPayload payload,
AuctionInvocationContext invocationContext) {

return delegate.apply(payload, invocationContext);
}

@Override
public String code() {
return code;
}
}
}
8 changes: 4 additions & 4 deletions src/test/java/org/prebid/server/it/hooks/HooksTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ca64df6

Please sign in to comment.