Skip to content

Commit fe55824

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
Formatted with Google Java Formatter
1 parent 3cd34e9 commit fe55824

File tree

10 files changed

+26
-31
lines changed

10 files changed

+26
-31
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.encrypt;
22

3-
public class HashAlgoExample {
4-
}
3+
public class HashAlgoExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.encrypt;
22

3-
public class MD5Example {
4-
}
3+
public class MD5Example {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.encrypt;
22

3-
public class URLEncoderExample {
4-
}
3+
public class URLEncoderExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.regex;
22

3-
public class PatternExample {
4-
}
3+
public class PatternExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.regex;
22

3-
public class SplitReplaceExample {
4-
}
3+
public class SplitReplaceExample {}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
package com.examplehub.basics.encrypt;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.junit.jupiter.api.Assertions.*;
64

5+
import org.junit.jupiter.api.Test;
6+
77
class HashAlgoExampleTest {
88
@Test
99
void testGetHash() {
1010
assertEquals(0x5e918d2, "hello".hashCode());
1111
assertEquals(0x7a9d88e8, "hello, java".hashCode());
1212
assertEquals(0xa0dbae2f, "hello, bob".hashCode());
1313
}
14+
1415
@Test
1516
void testCollision() {
1617
assertEquals(0x7460e8c0, "AaAaAa".hashCode());
1718
assertEquals(0x7460e8c0, "BBAaBB".hashCode());
1819
}
19-
}
20+
}

src/test/java/com/examplehub/basics/encrypt/MD5ExampleTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package com.examplehub.basics.encrypt;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
44

55
import java.math.BigInteger;
66
import java.nio.charset.StandardCharsets;
77
import java.security.MessageDigest;
88
import java.security.NoSuchAlgorithmException;
9-
10-
import static org.junit.jupiter.api.Assertions.assertEquals;
9+
import org.junit.jupiter.api.Test;
1110

1211
class MD5ExampleTest {
1312
@Test
@@ -25,7 +24,8 @@ void testSHA1() throws NoSuchAlgorithmException {
2524
messageDigest.update("Hello".getBytes(StandardCharsets.UTF_8));
2625
messageDigest.update("Word".getBytes(StandardCharsets.UTF_8));
2726
byte[] result = messageDigest.digest();
28-
assertEquals("bb91fbbc79de916e68ea0b4dcb7407bad1941aaf", new BigInteger(1, result).toString(16));
27+
assertEquals(
28+
"bb91fbbc79de916e68ea0b4dcb7407bad1941aaf", new BigInteger(1, result).toString(16));
2929
}
3030

3131
@Test
@@ -34,6 +34,8 @@ void testSHA256() throws NoSuchAlgorithmException {
3434
messageDigest.update("Hello".getBytes(StandardCharsets.UTF_8));
3535
messageDigest.update("Word".getBytes(StandardCharsets.UTF_8));
3636
byte[] result = messageDigest.digest();
37-
assertEquals("294a5c8e68aa0f68fa7f5309f65baf111b9b2e71b286319ca2c88ed40bb5020c", new BigInteger(1, result).toString(16));
37+
assertEquals(
38+
"294a5c8e68aa0f68fa7f5309f65baf111b9b2e71b286319ca2c88ed40bb5020c",
39+
new BigInteger(1, result).toString(16));
3840
}
39-
}
41+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.examplehub.basics.encrypt;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.net.URLDecoder;
66
import java.net.URLEncoder;
77
import java.nio.charset.StandardCharsets;
8-
9-
import static org.junit.jupiter.api.Assertions.*;
8+
import org.junit.jupiter.api.Test;
109

1110
class URLEncoderExampleTest {
1211
@Test
@@ -15,4 +14,4 @@ void testEncodeDecode() {
1514
assertEquals("%E4%B8%AD+%E6%96%87", encoded);
1615
assertEquals("中 文", URLDecoder.decode(encoded, StandardCharsets.UTF_8));
1716
}
18-
}
17+
}

src/test/java/com/examplehub/basics/regex/PatternExampleTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package com.examplehub.basics.regex;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.util.regex.Matcher;
66
import java.util.regex.Pattern;
7-
8-
import static org.junit.jupiter.api.Assertions.*;
7+
import org.junit.jupiter.api.Test;
98

109
class PatternExampleTest {
1110
@Test
@@ -73,4 +72,4 @@ void testGetZeroVersion2() {
7372
assertEquals("123", matcher.group(1));
7473
assertEquals("0000", matcher.group(2));
7574
}
76-
}
75+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.examplehub.basics.regex;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.util.Arrays;
6-
7-
import static org.junit.jupiter.api.Assertions.*;
6+
import org.junit.jupiter.api.Test;
87

98
class SplitReplaceExampleTest {
109
@Test
@@ -13,4 +12,4 @@ void testSplit() {
1312
assertEquals("[a, b, , c]", Arrays.toString("a b c".split("\\s")));
1413
assertEquals("[a, b, c]", Arrays.toString("a, b ;; c".split("[,;\\s]+")));
1514
}
16-
}
15+
}

0 commit comments

Comments
 (0)