Skip to content

Commit d8007ab

Browse files
committed
changed test class/method modifiers to pkg-private (PMD rule)
1 parent 4e2b189 commit d8007ab

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/test/java/org/apache/xml/security/test/dom/encryption/EncryptionFormattingTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* and data encryption key.
6161
*/
6262
@FormattingTest
63-
public class EncryptionFormattingTest {
63+
class EncryptionFormattingTest {
6464
private final Random random = new Random();
6565
private final FormattingChecker formattingChecker;
6666
private KeyStore keyStore;
@@ -85,7 +85,7 @@ public EncryptionFormattingTest() throws Exception {
8585
}
8686

8787
@Test
88-
public void testEncryptedFormatting() throws Exception {
88+
void testEncryptedFormatting() throws Exception {
8989
/* this test checks formatting of base64binary values */
9090
byte[] testData = new byte[128]; // long enough for line breaks
9191
random.nextBytes(testData);
@@ -106,7 +106,7 @@ public void testEncryptedFormatting() throws Exception {
106106
}
107107

108108
@Test
109-
public void testEncryptDecrypt() throws Exception {
109+
void testEncryptDecrypt() throws Exception {
110110
/* this test ensures that the encrypted data can be processed with various formatting settings */
111111
byte[] testData = new byte[128]; // long enough for line breaks
112112
random.nextBytes(testData);

src/test/java/org/apache/xml/security/test/dom/signature/SignatureFormattingTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* RSA-2048 and SHA-512 are used to create longer binary values.
6262
*/
6363
@FormattingTest
64-
public class SignatureFormattingTest {
64+
class SignatureFormattingTest {
6565
private final static byte[] MOCK_DATA = new byte[]{ 0x0a, 0x0b, 0x0c, 0x0d };
6666

6767
private final FormattingChecker formattingChecker;
@@ -89,7 +89,7 @@ public SignatureFormattingTest() throws Exception {
8989
}
9090

9191
@Test
92-
public void testSignatureFormatting() throws Exception {
92+
void testSignatureFormatting() throws Exception {
9393
/* this test checks formatting of base64Binary values */
9494
Document doc = createDocument();
9595

@@ -117,7 +117,7 @@ public void testSignatureFormatting() throws Exception {
117117
}
118118

119119
@Test
120-
public void testSignVerify() throws Exception {
120+
void testSignVerify() throws Exception {
121121
/* this test checks the signature can be verified with given formatting settings */
122122
Document doc = createDocument();
123123
Element signatureElement = findElementByXpath("//ds:Signature[1]", doc);

src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionFormattingTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* Also, decryption with StAX API is performed to ensure different formatting can be consumed.
7171
*/
7272
@FormattingTest
73-
public class EncryptionFormattingTest {
73+
class EncryptionFormattingTest {
7474
private Random random = new Random();
7575
private final FormattingChecker formattingChecker;
7676
private KeyStore keyStore;
@@ -98,7 +98,7 @@ public EncryptionFormattingTest() throws KeyStoreException {
9898
}
9999

100100
@Test
101-
public void testEncryptedFormatting() throws Exception {
101+
void testEncryptedFormatting() throws Exception {
102102
/* this test checks formatting of base64Binary values */
103103
byte[] documentBytes = createDocument();
104104

@@ -128,7 +128,7 @@ public void testEncryptedFormatting() throws Exception {
128128
}
129129

130130
@Test
131-
public void testEncryptDecrypt() throws Exception {
131+
void testEncryptDecrypt() throws Exception {
132132
/* this test ensures that the encrypted data can be processed with various formatting settings */
133133
byte[] documentBytes = createDocument();
134134

src/test/java/org/apache/xml/security/test/stax/signature/SignatureFormattingTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* Also, signature verification with StAX API is performed to ensure different formatting can be consumed.
6262
*/
6363
@FormattingTest
64-
public class SignatureFormattingTest {
64+
class SignatureFormattingTest {
6565
private final FormattingChecker formattingChecker;
6666
private KeyStore keyStore;
6767
private XPath xpath;
@@ -87,7 +87,7 @@ public SignatureFormattingTest() throws Exception {
8787
}
8888

8989
@Test
90-
public void testSignatureFormatting() throws Exception {
90+
void testSignatureFormatting() throws Exception {
9191
/* this test checks formatting of base64Binary values */
9292
byte[] documentBytes = createDocument();
9393

@@ -116,7 +116,7 @@ public void testSignatureFormatting() throws Exception {
116116
}
117117

118118
@Test
119-
public void testSignVerify() throws Exception {
119+
void testSignVerify() throws Exception {
120120
/* this test checks the signature can be verified with given formatting settings */
121121
byte[] documentBytes = createDocument();
122122

src/test/java/org/apache/xml/security/utils/XMLUtilsTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,43 +47,43 @@
4747
* formatting regardless of formatting options.
4848
*/
4949
@FormattingTest
50-
public class XMLUtilsTest {
50+
class XMLUtilsTest {
5151

5252
private FormattingChecker formattingChecker = FormattingCheckerFactory.getFormattingChecker();
5353

5454
/* Base64 encoding of the following bytes is: AQIDBAUGBwg= */
5555
private static final byte[] TEST_DATA = new byte[]{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
5656

5757
@Test
58-
public void testEncodeToString() {
58+
void testEncodeToString() {
5959
byte[] data = new byte[60]; // long enough for a line break in MIME encoding
6060
String encoded = XMLUtils.encodeToString(data);
6161
formattingChecker.checkBase64Value(encoded);
6262
}
6363

6464
@Test
65-
public void testEncodeToStringShort() {
65+
void testEncodeToStringShort() {
6666
byte[] data = new byte[8];
6767
String encoded = XMLUtils.encodeToString(data);
6868
formattingChecker.checkBase64Value(encoded);
6969
}
7070

7171
@Test
72-
public void testEncodeElementValue() {
72+
void testEncodeElementValue() {
7373
byte[] data = new byte[60]; // long enough for a line break in MIME encoding
7474
String encoded = XMLUtils.encodeElementValue(data);
7575
formattingChecker.checkBase64ValueWithSpacing(encoded);
7676
}
7777

7878
@Test
79-
public void testEncodeElementValueShort() {
79+
void testEncodeElementValueShort() {
8080
byte[] data = new byte[8];
8181
String encoded = XMLUtils.encodeElementValue(data);
8282
formattingChecker.checkBase64ValueWithSpacing(encoded);
8383
}
8484

8585
@Test
86-
public void testEncodeUsingStream() throws IOException {
86+
void testEncodeUsingStream() throws IOException {
8787
byte[] data = new byte[60];
8888
String expected = XMLUtils.encodeToString(data);
8989
String encodedWithStream;
@@ -98,7 +98,7 @@ public void testEncodeUsingStream() throws IOException {
9898
}
9999

100100
@Test
101-
public void decodeNoLineBreaks() {
101+
void decodeNoLineBreaks() {
102102
String encoded = "AQIDBAUGBwg=";
103103

104104
byte[] data = XMLUtils.decode(encoded);
@@ -109,7 +109,7 @@ public void decodeNoLineBreaks() {
109109
}
110110

111111
@Test
112-
public void decodeCrlfLineBreaks() {
112+
void decodeCrlfLineBreaks() {
113113
String encoded = "AQIDBAUG\r\nBwg=";
114114

115115
byte[] data = XMLUtils.decode(encoded);
@@ -120,7 +120,7 @@ public void decodeCrlfLineBreaks() {
120120
}
121121

122122
@Test
123-
public void decodeLfLineBreaks() {
123+
void decodeLfLineBreaks() {
124124
String encoded = "AQIDBAUG\nBwg=";
125125

126126
byte[] data = XMLUtils.decode(encoded);
@@ -131,7 +131,7 @@ public void decodeLfLineBreaks() {
131131
}
132132

133133
@Test
134-
public void decodeStream() throws IOException {
134+
void decodeStream() throws IOException {
135135
byte[] encodedBytes = "AQIDBAUGBwg=".getBytes(StandardCharsets.US_ASCII);
136136

137137
try (InputStream decoded = XMLUtils.decodeStream(new ByteArrayInputStream(encodedBytes))) {

0 commit comments

Comments
 (0)