Skip to content

Commit

Permalink
Fix Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoxaAntoxic committed Mar 7, 2024
1 parent f3f499a commit 27a50dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand Down Expand Up @@ -98,19 +89,16 @@ public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration()
null,
null,
null),
null)))),
null))
null)))))
.build())
.build();

// when
final Account actualAccount = target.resolve(givenAccount);

// 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(
Expand All @@ -134,8 +122,7 @@ public void resolveShouldRemoveInvalidRulesFromAccountActivitiesConfiguration()
null,
null,
null),
null)))),
null))
null))))).build())
.build());
}
}

0 comments on commit 27a50dc

Please sign in to comment.