From 55fac16bb13e5c09593c93283a43731c925a2aac Mon Sep 17 00:00:00 2001 From: Oleksandr Zhevedenko <720803+Net-burst@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:35:02 -0500 Subject: [PATCH] Ignore broken GreenBids tests (#3624) --- ...meDataProcessedAuctionRequestHookTest.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java index e1bde277c06..157b70b9474 100644 --- a/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java +++ b/extra/modules/greenbids-real-time-data/src/test/java/org/prebid/server/hooks/modules/greenbids/real/time/data/v1/GreenbidsRealTimeDataProcessedAuctionRequestHookTest.java @@ -15,6 +15,7 @@ import io.vertx.core.Future; import io.vertx.core.Vertx; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -87,13 +88,15 @@ public class GreenbidsRealTimeDataProcessedAuctionRequestHookTest { @Mock(strictness = LENIENT) private DatabaseReaderFactory databaseReaderFactory; + @Mock + private DatabaseReader dbReader; + private GreenbidsRealTimeDataProcessedAuctionRequestHook target; @BeforeEach public void setUp() throws IOException { final Storage storage = StorageOptions.newBuilder() .setProjectId("test_project").build().getService(); - final DatabaseReader dbReader = givenDatabaseReader(); final FilterService filterService = new FilterService(); final OnnxModelRunnerFactory onnxModelRunnerFactory = new OnnxModelRunnerFactory(); final ThrottlingThresholdsFactory throttlingThresholdsFactory = new ThrottlingThresholdsFactory(); @@ -159,6 +162,7 @@ public void callShouldExitEarlyWhenPartnerNotActivatedInBidRequest() { assertThat(result.analyticsTags()).isNull(); } + @Disabled("Broken until dbReader is mocked") @Test public void callShouldNotFilterBiddersAndReturnAnalyticsTagWhenExploration() throws OrtException, IOException { // given @@ -213,6 +217,7 @@ public void callShouldNotFilterBiddersAndReturnAnalyticsTagWhenExploration() thr assertThat(fingerprint).isNotNull(); } + @Disabled("Broken until dbReader is mocked") @Test public void callShouldFilterBiddersBasedOnModelWhenAnyFeatureNotAvailable() throws OrtException, IOException { // given @@ -273,6 +278,7 @@ public void callShouldFilterBiddersBasedOnModelWhenAnyFeatureNotAvailable() thro assertThat(resultBidRequest).usingRecursiveComparison().isEqualTo(expectedBidRequest); } + @Disabled("Broken until dbReader is mocked") @Test public void callShouldFilterBiddersBasedOnModelResults() throws OrtException, IOException { // given @@ -335,19 +341,6 @@ public void callShouldFilterBiddersBasedOnModelResults() throws OrtException, IO .isEqualTo(expectedBidRequest); } - static DatabaseReader givenDatabaseReader() throws IOException { - final URL url = new URL("https://git.io/GeoLite2-Country.mmdb"); - final Path databasePath = Files.createTempFile("GeoLite2-Country", ".mmdb"); - - try ( - InputStream inputStream = url.openStream(); - FileOutputStream outputStream = new FileOutputStream(databasePath.toFile())) { - inputStream.transferTo(outputStream); - } - - return new DatabaseReader.Builder(databasePath.toFile()).build(); - } - static ExtRequest givenExtRequest(Double explorationRate) { final ObjectNode greenbidsNode = TestBidRequestProvider.MAPPER.createObjectNode(); greenbidsNode.put("pbuid", "test-pbuid");