Skip to content

Commit

Permalink
Remove duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Dec 3, 2024
1 parent d5f3787 commit b586c05
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ private AdvertisingToken createAdvertisingToken(PublisherIdentity publisherIdent
int hash = ((rawUid[0] & 0xFF) << 12) | ((rawUid[1] & 0xFF) << 4) | ((rawUid[2] & 0xFF) & 0xF); //using same logic as ModBasedSaltEntryIndexer.getIndex() in uid2-shared
pseudoRandomNumber = (hash % 100) + 1; //1 to 100
}
tokenVersion = TokenVersion.V4;
return new AdvertisingToken(tokenVersion, now, now.plusMillis(identityExpiresAfter.toMillis()), this.operatorIdentity, publisherIdentity, userIdentity);
return new AdvertisingToken(TokenVersion.V4, now, now.plusMillis(identityExpiresAfter.toMillis()), this.operatorIdentity, publisherIdentity, userIdentity);
}

static protected class GlobalOptoutResult {
Expand Down
15 changes: 0 additions & 15 deletions src/test/java/com/uid2/operator/EUIDOperatorVerticleV4Test.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/test/java/com/uid2/operator/UIDOperatorServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ private UserIdentity createUserIdentity(String rawIdentityHash, IdentityScope sc
}

private AdvertisingToken validateAndGetToken(EncryptedTokenEncoder tokenEncoder, String advertisingTokenString, IdentityScope scope, IdentityType type, int siteId) {
TokenVersion tokenVersion = TokenVersion.V4;
UIDOperatorVerticleTest.validateAdvertisingToken(advertisingTokenString, tokenVersion, scope, type);
UIDOperatorVerticleTest.validateAdvertisingToken(advertisingTokenString, TokenVersion.V4, scope, type);
return tokenEncoder.decodeAdvertisingToken(advertisingTokenString);
}

Expand Down
14 changes: 0 additions & 14 deletions src/test/java/com/uid2/operator/UidOperatorVerticleV4Test.java

This file was deleted.

0 comments on commit b586c05

Please sign in to comment.