• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torresj / infosas-api / 51

11 Mar 2025 03:55PM UTC coverage: 93.529% (+0.5%) from 93.0%
51

push

circleci

Jaime Torres Benavente
New parameter DNI added for search staffs

43 of 44 new or added lines in 6 files covered. (97.73%)

318 of 340 relevant lines covered (93.53%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/main/java/com/torresj/infosas/utils/StringUtils.java
1
package com.torresj.infosas.utils;
2

NEW
3
public class StringUtils {
×
4
    public static String obfuscateDni(String dni) {
5
        // Check for null or empty dni
6
        if (dni == null || dni.isEmpty()) {
1✔
7
            return "";
1✔
8
        }
9

10
        int length = dni.length();
1✔
11

12
        // If string is 5 or fewer characters, can't apply the masking rule
13
        if (length <= 5) {
1✔
14
            return "";
1✔
15
        }
16

17
        // Create a StringBuilder for efficient string manipulation
18
        StringBuilder obfuscated = new StringBuilder();
1✔
19

20
        // Add three asterisks at the beginning
21
        obfuscated.append("***");
1✔
22

23
        // Add the middle part (unchanged)
24
        obfuscated.append(dni.substring(3, length - 2));
1✔
25

26
        // Add two asterisks at the end
27
        obfuscated.append("**");
1✔
28

29
        return obfuscated.toString();
1✔
30
    }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc