Skip to content

Commit

Permalink
Update test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanchyk authored and ozhevedenko committed Oct 11, 2021
1 parent 854f5b0 commit aece6c0
Show file tree
Hide file tree
Showing 44 changed files with 241 additions and 232 deletions.
21 changes: 14 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@
<maxmind-client.version>2.12.0</maxmind-client.version>

<!-- test dependencies versions -->
<junit.version>4.13.1</junit.version>
<mockito.version>2.23.4</mockito.version>
<assertj.version>3.8.0</assertj.version>
<wiremock.version>2.26.3</wiremock.version>
<awaitility.version>4.0.1</awaitility.version>
<junit.version>4.13.2</junit.version>
<mockito.version>3.12.4</mockito.version>
<assertj.version>3.21.0</assertj.version>
<wiremock.version>2.27.2</wiremock.version>
<awaitility.version>4.1.0</awaitility.version>
<jetty.version>9.4.43.v20210629</jetty.version>
<restassured.version>3.0.6</restassured.version>
<h2.version>1.4.196</h2.version>
<restassured.version>3.3.0</restassured.version>
<h2.version>1.4.200</h2.version>
<bytebuddy.version>1.11.13</bytebuddy.version>

<!-- plugin versions -->
<checkstyle-plugin.version>3.1.0</checkstyle-plugin.version>
Expand Down Expand Up @@ -400,6 +401,12 @@
<version>${restassured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<!-- for Mockito to be able to mock Vert.x-specific classes -->
<dependency>
<groupId>io.vertx</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;

public class PubstackAnalyticsReporterTest extends VertxTest {

Expand Down Expand Up @@ -118,8 +119,8 @@ public void initializeShouldFailUpdateSendBuffersAndSetTimerWhenEndpointFromRemo
.isInstanceOf(PreBidException.class);
verify(auctionHandler).reportEvents();
verify(setuidHandler).reportEvents();
verifyZeroInteractions(auctionHandler);
verifyZeroInteractions(setuidHandler);
verifyNoMoreInteractions(auctionHandler);
verifyNoMoreInteractions(setuidHandler);
verify(vertx).setPeriodic(anyLong(), any());
}

Expand Down Expand Up @@ -156,8 +157,8 @@ public void initializeShouldNotSendEventsAndUpdateConfigsWhenResponseStatusIsNot
// then
verify(vertx).setPeriodic(anyLong(), any());
verify(httpClient).get(anyString(), anyLong());
verifyZeroInteractions(auctionHandler);
verifyZeroInteractions(setuidHandler);
verifyNoInteractions(auctionHandler);
verifyNoInteractions(setuidHandler);
}

@Test
Expand All @@ -172,8 +173,8 @@ public void initializeShouldNotSendEventsAndUpdateConfigsWhenCantParseResponse()
// then
verify(vertx).setPeriodic(anyLong(), any());
verify(httpClient).get(anyString(), anyLong());
verifyZeroInteractions(auctionHandler);
verifyZeroInteractions(setuidHandler);
verifyNoInteractions(auctionHandler);
verifyNoInteractions(setuidHandler);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

public class PubstackEventHandlerTest extends VertxTest {

Expand Down Expand Up @@ -88,7 +88,7 @@ public void handleShouldNotAcceptEventsWhenNotEnabled() {
(AtomicReference<Set<String>>) ReflectionTestUtils
.getField(pubstackEventHandler, "events");
assertThat(events.get()).isEmpty();
verifyZeroInteractions(httpClient);
verifyNoInteractions(httpClient);
}

@Test
Expand Down
28 changes: 14 additions & 14 deletions src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.prebid.server.assertion.FutureAssertion.assertThat;
import static org.prebid.server.proto.openrtb.ext.response.BidType.banner;
import static org.prebid.server.proto.openrtb.ext.response.BidType.video;
Expand Down Expand Up @@ -351,8 +351,8 @@ public void shouldTolerateImpWithoutExtension() {
final BidResponse bidResponse = exchangeService.holdAuction(givenRequestContext(bidRequest)).result();

// then
verifyZeroInteractions(bidderCatalog);
verifyZeroInteractions(httpBidderRequester);
verifyNoInteractions(bidderCatalog);
verifyNoInteractions(httpBidderRequester);
assertThat(bidResponse).isNotNull();
}

Expand All @@ -368,7 +368,7 @@ public void shouldTolerateImpWithUnknownBidderInExtension() {

// then
verify(bidderCatalog).isValidName(eq("invalid"));
verifyZeroInteractions(httpBidderRequester);
verifyNoInteractions(httpBidderRequester);
assertThat(bidResponse).isNotNull();
}

Expand Down Expand Up @@ -507,7 +507,7 @@ public void shouldSkipBidderWhenRejectedByBidderRequestHooks() {
exchangeService.holdAuction(givenRequestContext(bidRequest));

// then
verifyZeroInteractions(httpBidderRequester);
verifyNoInteractions(httpBidderRequester);
}

@Test
Expand Down Expand Up @@ -667,7 +667,7 @@ public void shouldPassRequestWithExtPrebidToDefinedBidder() {
assertThat(prebid1).isNotNull();
final JsonNode bidders1 = prebid1.getBidders();
assertThat(bidders1).isNotNull();
assertThat(bidders1.fields()).hasSize(1)
assertThat(bidders1.fields()).toIterable().hasSize(1)
.containsOnly(entry("bidder", mapper.createObjectNode().put("test1", "test1")));

final ArgumentCaptor<BidderRequest> bidRequest2Captor = ArgumentCaptor.forClass(BidderRequest.class);
Expand All @@ -677,7 +677,7 @@ public void shouldPassRequestWithExtPrebidToDefinedBidder() {
assertThat(prebid2).isNotNull();
final JsonNode bidders2 = prebid2.getBidders();
assertThat(bidders2).isNotNull();
assertThat(bidders2.fields()).hasSize(1)
assertThat(bidders2.fields()).toIterable().hasSize(1)
.containsOnly(entry("bidder", mapper.createObjectNode().put("test2", "test2")));
}

Expand Down Expand Up @@ -796,7 +796,7 @@ public void shouldNotCreateRequestForBidderRestrictedByPrivacyEnforcement() {
exchangeService.holdAuction(givenRequestContext(bidRequest));

// then
verifyZeroInteractions(httpBidderRequester);
verifyNoInteractions(httpBidderRequester);
}

@Test
Expand Down Expand Up @@ -1787,7 +1787,7 @@ public void shouldAddMultiBidInfoAboutRequestedBidderIfDataShouldNotBeSuppressed
final ExtRequest extRequest = captureBidRequest().getExt();
assertThat(extRequest)
.extracting(ExtRequest::getPrebid)
.flatExtracting("multibid")
.extracting(ExtRequestPrebid::getMultibid).asList()
.containsExactly(ExtRequestPrebidMultiBid.of("someBidder", null, 3, "prefix"));
}

Expand All @@ -1807,7 +1807,7 @@ public void shouldAddMultibidInfoOnlyAboutRequestedBidder() {
final ExtRequest extRequest = captureBidRequest().getExt();
assertThat(extRequest)
.extracting(ExtRequest::getPrebid)
.flatExtracting("multibid")
.extracting(ExtRequestPrebid::getMultibid).asList()
.containsExactly(ExtRequestPrebidMultiBid.of("someBidder", null, 3, null));
}

Expand Down Expand Up @@ -2481,10 +2481,10 @@ public void shouldRemoveSiteIfBothSiteAndAppPresent() {
final BidRequest captureBidRequest = captureBidRequest();
assertThat(captureBidRequest)
.extracting(BidRequest::getSite)
.containsNull();
.isNull();
assertThat(captureBidRequest)
.extracting(BidRequest::getApp)
.doesNotContainNull();
.isNotNull();
}

@Test
Expand All @@ -2502,7 +2502,7 @@ public void shouldAddDebugWarningIfBothSiteAndAppPresent() {
// then
assertThat(givenContext)
.extracting(AuctionContext::getDebugWarnings)
.containsExactly(singletonList("BidRequest contains app and site. Removed site object"));
.isEqualTo(singletonList("BidRequest contains app and site. Removed site object"));
}

@Test
Expand Down Expand Up @@ -3253,7 +3253,7 @@ public void shouldReturnEmptyBidResponseWhenRequestIsRejected() {
final Future<BidResponse> result = exchangeService.holdAuction(auctionContext);

// then
verifyZeroInteractions(storedResponseProcessor, httpBidderRequester, hookStageExecutor, bidResponseCreator);
verifyNoInteractions(storedResponseProcessor, httpBidderRequester, hookStageExecutor, bidResponseCreator);
assertThat(result).succeededWith(BidResponse.builder()
.seatbid(emptyList())
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

public class PrivacyEnforcementServiceTest extends VertxTest {

Expand Down Expand Up @@ -407,7 +407,7 @@ public void shouldMaskForCoppaWhenDeviceLmtIsEnforceAndOneAndRegsCoppaIsOneAndDo
.build();
assertThat(result).isEqualTo(singletonList(expected));

verifyZeroInteractions(tcfDefinerService);
verifyNoInteractions(tcfDefinerService);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

public class StoredRequestProcessorTest extends VertxTest {

Expand Down Expand Up @@ -543,7 +543,7 @@ public void shouldReturnImpAndBidRequestWithoutChangesIfStoredRequestIsAbsentInP
final Future<BidRequest> bidRequestFuture = storedRequestProcessor.processStoredRequests(null, bidRequest);

// then
verifyZeroInteractions(applicationSettings, metrics);
verifyNoInteractions(applicationSettings, metrics);
assertThat(bidRequestFuture.succeeded()).isTrue();
assertThat(bidRequestFuture.result().getImp().get(0)).isSameAs(imp);
assertThat(bidRequestFuture.result()).isSameAs(bidRequest);
Expand Down Expand Up @@ -737,7 +737,7 @@ public void processStoredRequestsShouldNotUpdateMetricsIfApplicationSettingsFail
ExtRequestPrebid.builder().storedrequest(ExtStoredRequest.of("bidRequest")).build()))));

// then
verifyZeroInteractions(metrics);
verifyNoInteractions(metrics);
}

@Test
Expand All @@ -750,7 +750,7 @@ public void processAmpRequestShouldNotUpdateMetricsIfApplicationSettingsFailed()
storedRequestProcessor.processAmpRequest(null, "123", BidRequest.builder().build());

// then
verifyZeroInteractions(metrics);
verifyNoInteractions(metrics);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

public class StoredResponseProcessorTest extends VertxTest {

Expand Down Expand Up @@ -110,7 +110,7 @@ public void getStoredResponseResultShouldNotChangeImpsAndReturnSeatBidsWhenThere
singletonList(imp),
emptyList(),
emptyMap()));
verifyZeroInteractions(applicationSettings);
verifyNoInteractions(applicationSettings);
}

@Test
Expand All @@ -132,7 +132,7 @@ public void getStoredResponseResultShouldAddImpToRequiredRequestWhenItsStoredAuc
.build()),
emptyList(),
emptyMap()));
verifyZeroInteractions(applicationSettings);
verifyNoInteractions(applicationSettings);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.prebid.server.assertion.FutureAssertion.assertThat;

public class AmpRequestFactoryTest extends VertxTest {
Expand Down Expand Up @@ -184,7 +184,7 @@ public void shouldReturnFailedFutureIfRequestHasNoTagId() {
final Future<?> future = target.fromRequest(routingContext, 0L);

// then
verifyZeroInteractions(storedRequestProcessor);
verifyNoInteractions(storedRequestProcessor);
assertThat(future.failed()).isTrue();
assertThat(future.cause()).isInstanceOf(InvalidRequestException.class);
assertThat(((InvalidRequestException) future.cause()).getMessages())
Expand Down Expand Up @@ -1344,7 +1344,7 @@ public void shouldReturnBidRequestWithExtPrebidDataBiddersUpdatedByFpdResolver()
verify(fpdResolver).resolveBidRequestExt(any(), any());
assertThat(request)
.extracting(BidRequest::getExt)
.containsOnly(ExtRequest.of(ExtRequestPrebid.builder()
.isEqualTo(ExtRequest.of(ExtRequestPrebid.builder()
.data(ExtRequestPrebidData.of(Arrays.asList("appnexus", "rubicon"), null)).build()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ public void shouldSetSiteExtIfNoReferer() {
// then
assertThat(result.getSite())
.extracting(Site::getExt)
.containsOnly(ExtSite.of(0, null));
.isEqualTo(ExtSite.of(0, null));
}

@Test
Expand Down Expand Up @@ -1628,7 +1628,7 @@ public void shouldSetDefaultIncludeBidderKeysToFalseIfIncludeBidderKeysIsMissedA
// then
assertThat(result.getExt())
.extracting(extBidRequest -> extBidRequest.getPrebid().getTargeting().getIncludebidderkeys())
.containsOnly(false);
.isEqualTo(false);
}

@Test
Expand Down
Loading

0 comments on commit aece6c0

Please sign in to comment.