Skip to content

Commit

Permalink
✨ Add ipv4, ipv6 and first mask test case
Browse files Browse the repository at this point in the history
(cherry picked from commit ff9ce5f)
  • Loading branch information
lzhpo committed Mar 23, 2024
1 parent 7800fb7 commit c329819
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/lzhpo/sensitive/test/entity/SensitiveEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ public class SensitiveEntity {
@Sensitive(strategy = SensitiveStrategy.BANK_CARD)
private String bankCard;

@Sensitive(strategy = SensitiveStrategy.IPV4)
private String ipv4;

@Sensitive(strategy = SensitiveStrategy.IPV6)
private String ipv6;

@Sensitive(strategy = SensitiveStrategy.FIRST_MASK)
private String firstMask;

@Sensitive(strategy = SensitiveStrategy.CLEAR_TO_NULL)
private String clearToNull;

@Sensitive(strategy = SensitiveStrategy.CLEAR_TO_EMPTY)
private String clearToEmpty;

@Sensitive(strategy = SensitiveStrategy.CUSTOMIZE_KEEP_LENGTH)
@SensitiveKeepLength(preKeep = 1, postKeep = 1)
private String keepLength1;
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/com/lzhpo/sensitive/test/mock/MockHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public static SensitiveEntity sensitive() {
.password("123456")
.carLicense("粤A66666")
.bankCard("9988002866797031")
.ipv4("192.0.2.1")
.ipv6("2001:0db8:86a3:08d3:1319:8a2e:0370:7344")
.firstMask("123456789")
.clearToEmpty("123456")
.clearToNull("12345")
.bankCard("9988002866797031")
.keepLength1("1234")
.handler1("12345")
.filterWords1("卧槽,他妈的,我去你大爷的,草泥马")
Expand Down

0 comments on commit c329819

Please sign in to comment.