1212import org .mockito .junit .jupiter .MockitoExtension ;
1313import org .prebid .server .hooks .execution .v1 .auction .AuctionInvocationContextImpl ;
1414import org .prebid .server .hooks .execution .v1 .auction .AuctionRequestPayloadImpl ;
15+ import org .prebid .server .hooks .modules .liveintent .omni .channel .identity .model .IdResResponse ;
1516import org .prebid .server .hooks .modules .liveintent .omni .channel .identity .model .config .LiveIntentOmniChannelProperties ;
1617import org .prebid .server .hooks .modules .liveintent .omni .channel .identity .v1 .hooks .LiveIntentOmniChannelIdentityProcessedAuctionRequestHook ;
1718import org .prebid .server .hooks .v1 .InvocationAction ;
@@ -81,19 +82,14 @@ public void callShouldEnrichUserEidsWithRequestedEids() {
8182 final User givenUser = User .builder ().eids (singletonList (givenEid )).build ();
8283 final BidRequest givenBidRequest = BidRequest .builder ().id ("request" ).user (givenUser ).build ();
8384
84- final String givenResponseBody = """
85- {
86- "eids": [{
87- "source": "liveintent.com",
88- "uids": [{
89- "atype": 3,
90- "id": "id2"
91- }]
92- }]
93- }""" ;
85+ final Eid expectedEid = Eid .builder ()
86+ .source ("liveintent.com" )
87+ .uids (singletonList (Uid .builder ().id ("id2" ).atype (3 ).build ()))
88+ .build ();
9489
90+ final String responseBody = MAPPER .encodeToString (IdResResponse .of (List .of (expectedEid )));
9591 given (httpClient .post (any (), any (), any (), anyLong ()))
96- .willReturn (Future .succeededFuture (HttpClientResponse .of (200 , null , givenResponseBody )));
92+ .willReturn (Future .succeededFuture (HttpClientResponse .of (200 , null , responseBody )));
9793
9894 final AuctionInvocationContext auctionInvocationContext = AuctionInvocationContextImpl .of (
9995 null , null , false , null , null );
@@ -103,11 +99,6 @@ public void callShouldEnrichUserEidsWithRequestedEids() {
10399 target .call (AuctionRequestPayloadImpl .of (givenBidRequest ), auctionInvocationContext ).result ();
104100
105101 // then
106- final Eid expectedEid = Eid .builder ()
107- .source ("liveintent.com" )
108- .uids (singletonList (Uid .builder ().id ("id2" ).atype (3 ).build ()))
109- .build ();
110-
111102 assertThat (result .status ()).isEqualTo (InvocationStatus .success );
112103 assertThat (result .action ()).isEqualTo (InvocationAction .update );
113104 assertThat (result .payloadUpdate ().apply (AuctionRequestPayloadImpl .of (givenBidRequest )))
@@ -128,19 +119,14 @@ public void callShouldCreateUserAndUseRequestedEidsWhenUserIsAbsent() {
128119 // given
129120 final BidRequest givenBidRequest = BidRequest .builder ().id ("request" ).user (null ).build ();
130121
131- final String givenResponseBody = """
132- {
133- "eids": [{
134- "source": "liveintent.com",
135- "uids": [{
136- "atype": 3,
137- "id": "id2"
138- }]
139- }]
140- }""" ;
122+ final Eid expectedEid = Eid .builder ()
123+ .source ("liveintent.com" )
124+ .uids (singletonList (Uid .builder ().id ("id2" ).atype (3 ).build ()))
125+ .build ();
141126
127+ final String responseBody = MAPPER .encodeToString (IdResResponse .of (List .of (expectedEid )));
142128 given (httpClient .post (any (), any (), any (), anyLong ()))
143- .willReturn (Future .succeededFuture (HttpClientResponse .of (200 , null , givenResponseBody )));
129+ .willReturn (Future .succeededFuture (HttpClientResponse .of (200 , null , responseBody )));
144130
145131 final AuctionInvocationContext auctionInvocationContext = AuctionInvocationContextImpl .of (
146132 null , null , false , null , null );
@@ -150,11 +136,6 @@ public void callShouldCreateUserAndUseRequestedEidsWhenUserIsAbsent() {
150136 target .call (AuctionRequestPayloadImpl .of (givenBidRequest ), auctionInvocationContext ).result ();
151137
152138 // then
153- final Eid expectedEid = Eid .builder ()
154- .source ("liveintent.com" )
155- .uids (singletonList (Uid .builder ().id ("id2" ).atype (3 ).build ()))
156- .build ();
157-
158139 assertThat (result .status ()).isEqualTo (InvocationStatus .success );
159140 assertThat (result .action ()).isEqualTo (InvocationAction .update );
160141 assertThat (result .payloadUpdate ().apply (AuctionRequestPayloadImpl .of (givenBidRequest )))
0 commit comments