Skip to content

Commit

Permalink
fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
przemkaczmarek committed Jan 30, 2025
1 parent ac1eb72 commit 9287f80
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/test/java/org/prebid/server/bidder/kobler/KoblerBidderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void creationShouldFailOnInvalidEndpointUrl() {
@Test
public void makeHttpRequestsShouldReturnErrorIfNoValidImps() {
// Given
BidRequest bidRequest = BidRequest.builder()
final BidRequest bidRequest = BidRequest.builder()
.imp(singletonList(Imp.builder()
.bidfloor(BigDecimal.ONE)
.bidfloorcur("EUR")
Expand All @@ -75,7 +75,7 @@ public void makeHttpRequestsShouldReturnErrorIfNoValidImps() {
.thenThrow(new PreBidException("Currency conversion failed"));

// When
Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// Then
assertThat(result.getErrors()).hasSize(1)
Expand All @@ -85,10 +85,10 @@ public void makeHttpRequestsShouldReturnErrorIfNoValidImps() {
@Test
public void makeHttpRequestsShouldReturnErrorIfNoImps() {
// Given
BidRequest bidRequest = BidRequest.builder().imp(emptyList()).build();
final BidRequest bidRequest = BidRequest.builder().imp(emptyList()).build();

// When
Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// Then
assertThat(result.getErrors()).hasSize(1)
Expand All @@ -98,15 +98,15 @@ public void makeHttpRequestsShouldReturnErrorIfNoImps() {
@Test
public void makeHttpRequestsShouldConvertBidFloorCurrency() {
// Given
BidRequest bidRequest = givenBidRequest(imp -> imp
final BidRequest bidRequest = givenBidRequest(imp -> imp
.bidfloor(BigDecimal.ONE)
.bidfloorcur("EUR"));

when(currencyConversionService.convertCurrency(any(), any(), any(), any()))
.thenReturn(BigDecimal.TEN);

// When
Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// Then
assertThat(result.getErrors()).isEmpty();
Expand All @@ -118,11 +118,11 @@ public void makeHttpRequestsShouldConvertBidFloorCurrency() {
@Test
public void makeHttpRequestsShouldUseDevEndpointWhenTestModeEnabled() {
// Given
BidRequest bidRequest = givenBidRequest(imp -> imp
final BidRequest bidRequest = givenBidRequest(imp -> imp
.ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpKobler.of(true)))));

// When
Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// Then
assertThat(result.getValue()).hasSize(1);
Expand All @@ -132,11 +132,11 @@ public void makeHttpRequestsShouldUseDevEndpointWhenTestModeEnabled() {
@Test
public void makeHttpRequestsShouldAddUsdToCurrenciesIfMissing() {
// Given
BidRequest bidRequest = givenBidRequest(identity())
final BidRequest bidRequest = givenBidRequest(identity())
.toBuilder().cur(singletonList("EUR")).build();

// When
Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// Then
assertThat(result.getValue().get(0).getPayload().getCur())
Expand All @@ -146,10 +146,10 @@ public void makeHttpRequestsShouldAddUsdToCurrenciesIfMissing() {
@Test
public void makeBidsShouldReturnErrorIfResponseBodyIsInvalid() {
// Given
BidderCall<BidRequest> httpCall = givenHttpCall();
final BidderCall<BidRequest> httpCall = givenHttpCall();

// When
Result<List<BidderBid>> result = target.makeBids(httpCall, BidRequest.builder().build());
final Result<List<BidderBid>> result = target.makeBids(httpCall, BidRequest.builder().build());

// Then
assertThat(result.getErrors()).hasSize(1)
Expand All @@ -162,10 +162,10 @@ public void makeBidsShouldReturnErrorIfResponseBodyIsInvalid() {
@Test
public void makeBidsShouldReturnBidsWithCorrectTypes() throws JsonProcessingException {
// Given
ObjectNode bidExt = mapper.createObjectNode()
final ObjectNode bidExt = mapper.createObjectNode()
.set("prebid", mapper.createObjectNode().put("type", "banner"));

BidderCall<BidRequest> httpCall = givenHttpCall(
final BidderCall<BidRequest> httpCall = givenHttpCall(
BidResponse.builder()
.cur("USD")
.seatbid(singletonList(SeatBid.builder()
Expand All @@ -177,7 +177,7 @@ public void makeBidsShouldReturnBidsWithCorrectTypes() throws JsonProcessingExce
.build());

// When
Result<List<BidderBid>> result = target.makeBids(httpCall, BidRequest.builder().build());
final Result<List<BidderBid>> result = target.makeBids(httpCall, BidRequest.builder().build());

// Then
assertThat(result.getErrors()).isEmpty();
Expand All @@ -189,12 +189,12 @@ public void makeBidsShouldReturnBidsWithCorrectTypes() throws JsonProcessingExce
@Test
public void extractTestModeShouldReturnTrueWhenImpExtHasTestTrue() {
// Given
Imp imp = Imp.builder()
final Imp imp = Imp.builder()
.ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpKobler.of(true))))
.build();

// When
boolean testMode = target.extractTestMode(imp);
final boolean testMode = target.extractTestMode(imp);

// Then
assertThat(testMode).isTrue();
Expand Down

0 comments on commit 9287f80

Please sign in to comment.