Skip to content

Commit 06e1a34

Browse files
Escaping whitespace in text block for test where the whitespace is intentional
1 parent 1489882 commit 06e1a34

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/PemFormatterTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ public class PemFormatterTest {
99
@Test
1010
public void When_CertHasExtraWhitespace_Expect_ItIsTrimmed() {
1111

12-
// this warning is suppressed as the extra whitespace (including trailing whitespace) is intentional
13-
@SuppressWarnings("com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSingleLineCheck")
12+
//The extra whitespace (including trailing whitespace) is intentional for this test and has been suppressed with `\s`
1413
final String withWhitespace = """
1514
-----BEGIN CERTIFICATE-----
16-
MIIFXzCCA0egAwIBAgIJALRbCSor9bEbMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
17-
18-
15+
MIIFXzCCA0egAwIBAgIJALRbCSor9bEbMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV \s
16+
\s
17+
\s
1918
W/JNIRmhLoeFNGNh8HvhI2PwOCsFiqT1rrCaUtusTyH0Ggs=
20-
21-
-----END CERTIFICATE-----
22-
""";
19+
\s
20+
-----END CERTIFICATE----- \s
21+
\s""";
2322

2423
final String trimmed = """
2524
-----BEGIN CERTIFICATE-----

0 commit comments

Comments
 (0)