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

Update test dependencies #1527

Merged
merged 29 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
99fad81
Adds that video ads are returned as VAST wrappers via the 'adm' field…
yevhenii-viktorov Oct 5, 2021
a95573f
added one test case to cover video change
yevhenii-viktorov Oct 5, 2021
a9f8300
test covers only adm creation
yevhenii-viktorov Oct 6, 2021
896ce0c
this commit will check adm with nurl inside it
yevhenii-viktorov Oct 6, 2021
bfd5c11
Check if result containsExactly in test instead of satisfies
yevhenii-viktorov Oct 7, 2021
7b3736d
Update test dependencies: tests refactoring to update AssertJ
yevhenii-viktorov Oct 7, 2021
8dd3204
Update test dependencies: tests refactoring to update Mockito part1
yevhenii-viktorov Oct 8, 2021
49d1ce3
Update test dependencies: tests refactoring to update Mockito part2 r…
yevhenii-viktorov Oct 8, 2021
6915951
Update test dependencies: tests refactoring all green
yevhenii-viktorov Oct 8, 2021
55ffc6f
Move bytebuddy dependency version to appropriate place
yevhenii-viktorov Oct 8, 2021
3920ef7
Adds that video ads are returned as VAST wrappers via the 'adm' field…
yevhenii-viktorov Oct 5, 2021
ca1d066
this commit will check adm with nurl inside it
yevhenii-viktorov Oct 6, 2021
c6930a0
Update test dependencies: tests refactoring to update AssertJ
yevhenii-viktorov Oct 7, 2021
cf4c702
Update test dependencies: tests refactoring to update Mockito part1
yevhenii-viktorov Oct 8, 2021
2522c6a
Update test dependencies: tests refactoring to update Mockito part2 r…
yevhenii-viktorov Oct 8, 2021
a3e34e7
Update test dependencies: tests refactoring all green
yevhenii-viktorov Oct 8, 2021
ad03c04
Move bytebuddy dependency version to appropriate place
yevhenii-viktorov Oct 8, 2021
527382d
Merge remote-tracking branch 'Prebid/update/test-dependencies' into u…
yevhenii-viktorov Oct 8, 2021
1b9d4ff
Fix merges after rebase
yevhenii-viktorov Oct 8, 2021
aece6c0
Update test dependencies
rpanchyk Oct 6, 2021
c04e7ab
Bump Mockito
Oct 11, 2021
378aab7
Merge remote-tracking branch 'Prebid/master' into update/test-depende…
yevhenii-viktorov Oct 25, 2021
9da09e3
Fix my merge
yevhenii-viktorov Oct 25, 2021
e6c4e9c
Change .containsOnly to .containsExactlyInAnyOrder for Iterable types…
yevhenii-viktorov Oct 25, 2021
862b1e8
Remove unnecessary .hasSize()
yevhenii-viktorov Oct 25, 2021
8641766
Refactor 2 assertions in one in ExchangeServiceTest
yevhenii-viktorov Oct 25, 2021
e774db3
Revert test
yevhenii-viktorov Oct 26, 2021
0bac227
Merge branch 'master' into update/test-dependencies
Nov 11, 2021
11a1130
Pom resolution
Nov 11, 2021
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
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>4.0.0</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.19</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)
rpanchyk marked this conversation as resolved.
Show resolved Hide resolved
.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