Skip to content

Commit

Permalink
Axis: Updated url (#2873)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiNahornyi authored Jan 3, 2024
1 parent ab38a35 commit 7afebb8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
10 changes: 1 addition & 9 deletions src/main/java/org/prebid/server/bidder/axis/AxisBidder.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class AxisBidder implements Bidder<BidRequest> {
private static final TypeReference<ExtPrebid<?, ExtImpAxis>> ADMAN_EXT_TYPE_REFERENCE =
new TypeReference<>() {
};
private static final String ACCOUNT_ID_MACRO = "{{AccountID}}";
private static final String SOURCE_ID_MACRO = "{{SourceId}}";

private final String endpointUrl;
private final JacksonMapper mapper;
Expand Down Expand Up @@ -74,13 +72,7 @@ private HttpRequest<BidRequest> makeRequest(BidRequest bidRequest, Imp imp, ExtI
.imp(Collections.singletonList(imp))
.build();

return BidderUtil.defaultRequest(modifyBidRequest, resolveUrl(extImpAxis), mapper);
}

private String resolveUrl(ExtImpAxis extImpAxis) {
return endpointUrl
.replace(ACCOUNT_ID_MACRO, HttpUtil.encodeUrl(extImpAxis.getIntegration()))
.replace(SOURCE_ID_MACRO, HttpUtil.encodeUrl(extImpAxis.getToken()));
return BidderUtil.defaultRequest(modifyBidRequest, endpointUrl, mapper);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/bidder-config/axis.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
adapters:
axis:
endpoint: http://prebid.axis-marketplace.com/{{AccountID}}?token={{SourceId}}
endpoint: http://prebid.axis-marketplace.com/pbserver
meta-info:
maintainer-email: [email protected]
app-media-types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class AxisBidderTest extends VertxTest {

public static final String ENDPOINT_URL = "https://test.endpoint.com/{{AccountID}}?token={{SourceId}}";
public static final String ENDPOINT_URL = "https://test.endpoint.com";

private final AxisBidder target = new AxisBidder(ENDPOINT_URL, jacksonMapper);

Expand Down Expand Up @@ -71,7 +71,7 @@ public void makeHttpRequestsShouldReturnExpectedUrl() {
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue())
.extracting(HttpRequest::getUri)
.containsExactly("https://test.endpoint.com/testIntegration?token=testToken");
.containsExactly("https://test.endpoint.com");
}

@Test
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/org/prebid/server/it/AxisTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.io.IOException;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
Expand All @@ -22,8 +21,7 @@ public class AxisTest extends IntegrationTest {
@Test
public void openrtb2AuctionShouldRespondWithBidsFromAxis() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/axis-exchange/intgrn"))
.withQueryParam("token", equalTo("tokenA"))
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/axis-exchange"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/axis/test-axis-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom("openrtb2/axis/test-axis-bid-response.json"))));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ adapters.automatad.endpoint=http://localhost:8090/automatad-exchange
adapters.avocet.enabled=true
adapters.avocet.endpoint=http://localhost:8090/avocet-exchange
adapters.axis.enabled=true
adapters.axis.endpoint=http://localhost:8090/axis-exchange/{{AccountID}}?token={{SourceId}}
adapters.axis.endpoint=http://localhost:8090/axis-exchange
adapters.axonix.enabled=true
adapters.axonix.endpoint=http://localhost:8090/axonix-exchange
adapters.beachfront.enabled=true
Expand Down

0 comments on commit 7afebb8

Please sign in to comment.