From 27a50dc92ee0df61bc183990c0533fd4e9e5d0cb Mon Sep 17 00:00:00 2001 From: antonbabak Date: Thu, 7 Mar 2024 14:58:29 +0100 Subject: [PATCH] Fix Conflicts --- .../activity/ActivitiesConfigResolver.java | 11 +++----- .../ActivitiesConfigResolverTest.java | 25 +++++-------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/prebid/server/activity/ActivitiesConfigResolver.java b/src/main/java/org/prebid/server/activity/ActivitiesConfigResolver.java index 419531cba5c..df267438a4a 100644 --- a/src/main/java/org/prebid/server/activity/ActivitiesConfigResolver.java +++ b/src/main/java/org/prebid/server/activity/ActivitiesConfigResolver.java @@ -36,14 +36,11 @@ public Account resolve(Account account) { .formatted(account.getId()), logSamplingRate); - final AccountPrivacyConfig privacyConfig = account.getPrivacy(); + final AccountPrivacyConfig accountPrivacyConfig = account.getPrivacy(); return account.toBuilder() - .privacy(AccountPrivacyConfig.of( - privacyConfig.getGdpr(), - privacyConfig.getCcpa(), - privacyConfig.getDsa(), - removeInvalidRules(privacyConfig.getActivities()), - privacyConfig.getModules())) + .privacy(accountPrivacyConfig.toBuilder() + .activities(removeInvalidRules(accountPrivacyConfig.getActivities())) + .build()) .build(); } diff --git a/src/test/java/org/prebid/server/activity/ActivitiesConfigResolverTest.java b/src/test/java/org/prebid/server/activity/ActivitiesConfigResolverTest.java index 455f0f92624..49f0d1de34e 100644 --- a/src/test/java/org/prebid/server/activity/ActivitiesConfigResolverTest.java +++ b/src/test/java/org/prebid/server/activity/ActivitiesConfigResolverTest.java @@ -43,13 +43,7 @@ public void resolveShouldReturnAccountAsIsWhenAccountPrivacyNull() { @Test public void resolveShouldReturnAccountAsIsWhenAccountPrivacyActivitiesNull() { // given - final Account givenAccount = Account.builder().privacy(AccountPrivacyConfig.of( - null, - null, - null, - null, - null)) - .build(); + final Account givenAccount = Account.builder().privacy(AccountPrivacyConfig.builder().build()).build(); // when final Account result = target.resolve(givenAccount); @@ -62,10 +56,7 @@ public void resolveShouldReturnAccountAsIsWhenAccountPrivacyActivitiesNull() { public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration() { // given final Account givenAccount = Account.builder() - .privacy(AccountPrivacyConfig.of( - null, - null, - null, + .privacy(AccountPrivacyConfig.builder().activities( Map.of( Activity.SYNC_USER, AccountActivityConfiguration.of(null, null), Activity.CALL_BIDDER, AccountActivityConfiguration.of(null, asList( @@ -98,8 +89,8 @@ public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration() null, null, null), - null)))), - null)) + null))))) + .build()) .build(); // when @@ -107,10 +98,7 @@ public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration() // then assertThat(actualAccount).isEqualTo(Account.builder() - .privacy(AccountPrivacyConfig.of( - null, - null, - null, + .privacy(AccountPrivacyConfig.builder().activities( Map.of( Activity.SYNC_USER, AccountActivityConfiguration.of(null, null), Activity.CALL_BIDDER, AccountActivityConfiguration.of(null, asList( @@ -134,8 +122,7 @@ public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration() null, null, null), - null)))), - null)) + null))))).build()) .build()); } }