From 486bf699b332bcf3f48eeab2004d5458c9617add Mon Sep 17 00:00:00 2001 From: antonbabak Date: Thu, 19 Dec 2024 13:37:56 +0100 Subject: [PATCH] Rename a property --- .../org/prebid/server/floors/BasicPriceFloorProcessor.java | 2 +- src/main/java/org/prebid/server/floors/PriceFloorFetcher.java | 2 +- .../org/prebid/server/floors/PriceFloorsConfigResolver.java | 4 ++-- .../server/settings/model/AccountPriceFloorsConfig.java | 2 +- .../server/settings/model/AccountPriceFloorsFetchConfig.java | 2 +- .../prebid/server/floors/BasicPriceFloorProcessorTest.java | 2 +- .../java/org/prebid/server/floors/PriceFloorFetcherTest.java | 4 ++-- .../prebid/server/floors/PriceFloorsConfigResolverTest.java | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/prebid/server/floors/BasicPriceFloorProcessor.java b/src/main/java/org/prebid/server/floors/BasicPriceFloorProcessor.java index 595df616bb6..91559480537 100644 --- a/src/main/java/org/prebid/server/floors/BasicPriceFloorProcessor.java +++ b/src/main/java/org/prebid/server/floors/BasicPriceFloorProcessor.java @@ -141,7 +141,7 @@ private PriceFloorRules resolveFloors(Account account, BidRequest bidRequest, Li final Long maxRules = priceFloorsConfig.map(AccountPriceFloorsConfig::getMaxRules) .orElse(null); - final Long maxDimensions = priceFloorsConfig.map(AccountPriceFloorsConfig::getMaxSchemaDimensions) + final Long maxDimensions = priceFloorsConfig.map(AccountPriceFloorsConfig::getMaxSchemaDims) .orElse(null); PriceFloorRulesValidator.validateRules( diff --git a/src/main/java/org/prebid/server/floors/PriceFloorFetcher.java b/src/main/java/org/prebid/server/floors/PriceFloorFetcher.java index 32a04da1def..b7d4ac4185f 100644 --- a/src/main/java/org/prebid/server/floors/PriceFloorFetcher.java +++ b/src/main/java/org/prebid/server/floors/PriceFloorFetcher.java @@ -179,7 +179,7 @@ private ResponseCacheInfo parseFloorResponse(HttpClientResponse httpClientRespon PriceFloorRulesValidator.validateRulesData( priceFloorData, PriceFloorsConfigResolver.resolveMaxValue(fetchConfig.getMaxRules()), - PriceFloorsConfigResolver.resolveMaxValue(fetchConfig.getMaxSchemaDimensions())); + PriceFloorsConfigResolver.resolveMaxValue(fetchConfig.getMaxSchemaDims())); return ResponseCacheInfo.of(priceFloorData, FetchStatus.success, diff --git a/src/main/java/org/prebid/server/floors/PriceFloorsConfigResolver.java b/src/main/java/org/prebid/server/floors/PriceFloorsConfigResolver.java index 7d21528f803..14834e24b7c 100644 --- a/src/main/java/org/prebid/server/floors/PriceFloorsConfigResolver.java +++ b/src/main/java/org/prebid/server/floors/PriceFloorsConfigResolver.java @@ -78,7 +78,7 @@ private static void validatePriceFloorConfig(Account account) { throw new PreBidException(invalidPriceFloorsPropertyMessage("max-rules", maxRules)); } - final Long maxDimensions = floorsConfig.getMaxSchemaDimensions(); + final Long maxDimensions = floorsConfig.getMaxSchemaDims(); if (maxDimensions != null && isNotInRange(maxDimensions, MIN_DIMENSIONS_VALUE, MAX_DIMENSIONS_VALUE)) { throw new PreBidException(invalidPriceFloorsPropertyMessage("max-schema-dimensions", maxDimensions)); } @@ -120,7 +120,7 @@ private static void validatePriceFloorsFetchConfig(AccountPriceFloorsFetchConfig throw new PreBidException(invalidPriceFloorsPropertyMessage("max-rules", maxRules)); } - final Long maxDimensions = fetchConfig.getMaxSchemaDimensions(); + final Long maxDimensions = fetchConfig.getMaxSchemaDims(); if (maxDimensions != null && isNotInRange(maxDimensions, MIN_DIMENSIONS_VALUE, MAX_DIMENSIONS_VALUE)) { throw new PreBidException(invalidPriceFloorsPropertyMessage("max-schema-dimensions", maxDimensions)); } diff --git a/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsConfig.java b/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsConfig.java index 5217b4ecd8b..9acebb1c427 100644 --- a/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsConfig.java +++ b/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsConfig.java @@ -28,5 +28,5 @@ public class AccountPriceFloorsConfig { Long maxRules; @JsonAlias("max-schema-dims") - Long maxSchemaDimensions; + Long maxSchemaDims; } diff --git a/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsFetchConfig.java b/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsFetchConfig.java index 7eab14fe3d0..42824b410e2 100644 --- a/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsFetchConfig.java +++ b/src/main/java/org/prebid/server/settings/model/AccountPriceFloorsFetchConfig.java @@ -22,7 +22,7 @@ public class AccountPriceFloorsFetchConfig { Long maxRules; @JsonAlias("max-schema-dims") - Long maxSchemaDimensions; + Long maxSchemaDims; @JsonAlias("max-age-sec") Long maxAgeSec; diff --git a/src/test/java/org/prebid/server/floors/BasicPriceFloorProcessorTest.java b/src/test/java/org/prebid/server/floors/BasicPriceFloorProcessorTest.java index 332f33d6623..78ce82dd3fd 100644 --- a/src/test/java/org/prebid/server/floors/BasicPriceFloorProcessorTest.java +++ b/src/test/java/org/prebid/server/floors/BasicPriceFloorProcessorTest.java @@ -434,7 +434,7 @@ public void shouldTolerateUsingFloorsFromRequestWhenDimensionsNumberMoreThanMaxD .build())) .build()) )), - givenAccount(floorConfigBuilder -> floorConfigBuilder.maxSchemaDimensions(1L)), + givenAccount(floorConfigBuilder -> floorConfigBuilder.maxSchemaDims(1L)), "bidder", errors, new ArrayList<>()); diff --git a/src/test/java/org/prebid/server/floors/PriceFloorFetcherTest.java b/src/test/java/org/prebid/server/floors/PriceFloorFetcherTest.java index f37dec221e2..4fe2e31180b 100644 --- a/src/test/java/org/prebid/server/floors/PriceFloorFetcherTest.java +++ b/src/test/java/org/prebid/server/floors/PriceFloorFetcherTest.java @@ -514,7 +514,7 @@ public void fetchShouldReturnNullAndCreatePeriodicTimerWhenResponseExceededDimen // when final FetchResult firstInvocationResult = - priceFloorFetcher.fetch(givenAccount(account -> account.maxSchemaDimensions(1L))); + priceFloorFetcher.fetch(givenAccount(account -> account.maxSchemaDims(1L))); // then verify(httpClient).get(anyString(), anyLong(), anyLong()); @@ -547,7 +547,7 @@ private static AccountPriceFloorsFetchConfig givenFetchConfig( .enabled(true) .url("http://test.host.com") .maxRules(10L) - .maxSchemaDimensions(10L) + .maxSchemaDims(10L) .maxFileSizeKb(10L) .timeoutMs(1300L) .maxAgeSec(1500L) diff --git a/src/test/java/org/prebid/server/floors/PriceFloorsConfigResolverTest.java b/src/test/java/org/prebid/server/floors/PriceFloorsConfigResolverTest.java index 2b3fe2ba0f8..9f975335cd9 100644 --- a/src/test/java/org/prebid/server/floors/PriceFloorsConfigResolverTest.java +++ b/src/test/java/org/prebid/server/floors/PriceFloorsConfigResolverTest.java @@ -191,7 +191,7 @@ public void resolveShouldReturnGivenAccountIfMaxRulesMoreThanMaximumValue() { @Test public void resolveShouldReturnGivenAccountIfMaxDimensionsLessThanMinimumValue() { // given - final Account givenAccount = accountWithFloorsFetchConfig(config -> config.maxSchemaDimensions(-1L)); + final Account givenAccount = accountWithFloorsFetchConfig(config -> config.maxSchemaDims(-1L)); // when final Account actualAccount = target.resolve(givenAccount, defaultPriceConfig()); @@ -204,7 +204,7 @@ public void resolveShouldReturnGivenAccountIfMaxDimensionsLessThanMinimumValue() @Test public void resolveShouldReturnGivenAccountIfMaxDimensionsMoreThanMaximumValue() { // given - final Account givenAccount = accountWithFloorsFetchConfig(config -> config.maxSchemaDimensions(20L)); + final Account givenAccount = accountWithFloorsFetchConfig(config -> config.maxSchemaDims(20L)); // when final Account actualAccount = target.resolve(givenAccount, defaultPriceConfig());