Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis: Updated url #2873

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading