Skip to content

Commit f8902c4

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
Formatted with Google Java Formatter
1 parent acfd28a commit f8902c4

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
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.system;
22

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

3-
public class DateTimeFormatExample {
4-
}
3+
public class DateTimeFormatExample {}

src/test/java/com/examplehub/basics/chars/StringBuilderExampleTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ void testToString() {
1111
StringBuilder builder = new StringBuilder("hello123");
1212
assertEquals("hello123", builder.toString());
1313
}
14+
1415
@Test
1516
void testCapacity() {
1617
StringBuilder sb = new StringBuilder();
@@ -25,9 +26,9 @@ void testCapacity() {
2526

2627
@Test
2728
void testAppend() {
28-
StringBuilder builder = new StringBuilder();
29-
builder.append("Hello").append(",").append("World").append("!");
30-
assertEquals("Hello,World!", builder.toString());
29+
StringBuilder builder = new StringBuilder();
30+
builder.append("Hello").append(",").append("World").append("!");
31+
assertEquals("Hello,World!", builder.toString());
3132
}
3233

3334
@Test
@@ -47,7 +48,7 @@ void testDeleteCharAt() {
4748
builder.deleteCharAt(0);
4849
assertEquals("ello123abc", builder.toString());
4950

50-
//delete ello
51+
// delete ello
5152
for (int i = 1; i <= 4; i++) {
5253
builder.deleteCharAt(0);
5354
}

src/test/java/com/examplehub/basics/system/SystemExampleTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.examplehub.basics.system;
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 SystemExampleTest {
88
@Test
99
void testCurrentTime() {
@@ -16,4 +16,4 @@ void testCurrentTime() {
1616
long endTime = System.currentTimeMillis();
1717
assertTrue(endTime >= startTime);
1818
}
19-
}
19+
}

src/test/java/com/examplehub/basics/time/CalendarExampleTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package com.examplehub.basics.time;
22

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

55
import java.text.SimpleDateFormat;
66
import java.util.Calendar;
7-
8-
import static org.junit.jupiter.api.Assertions.*;
7+
import org.junit.jupiter.api.Test;
98

109
class CalendarExampleTest {
1110

1211
@Test
1312
void testInit() {
1413
Calendar calendar = Calendar.getInstance();
1514
calendar.set(2099, Calendar.DECEMBER, 31, 23, 59, 59);
16-
assertEquals("2099-12-31 23:59:59",
17-
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
15+
assertEquals(
16+
"2099-12-31 23:59:59",
17+
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
1818
}
1919

2020
@Test
@@ -43,8 +43,9 @@ void testSetCustomTime() {
4343
calendar.set(Calendar.MINUTE, 33);
4444
calendar.set(Calendar.SECOND, 59);
4545

46-
assertEquals("2088-09-25 16:33:59",
47-
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
46+
assertEquals(
47+
"2088-09-25 16:33:59",
48+
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
4849
}
4950

5051
@Test
@@ -59,7 +60,8 @@ void testAddField() {
5960
calendar.set(Calendar.SECOND, 59);
6061

6162
calendar.add(Calendar.YEAR, 12);
62-
assertEquals("2100-09-25 16:33:59",
63-
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
63+
assertEquals(
64+
"2100-09-25 16:33:59",
65+
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime()));
6466
}
6567
}

src/test/java/com/examplehub/basics/time/DateExampleTest.java

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

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertTrue;
45

56
import java.text.ParseException;
67
import java.text.SimpleDateFormat;
78
import java.util.Date;
8-
9-
import static org.junit.jupiter.api.Assertions.assertEquals;
10-
import static org.junit.jupiter.api.Assertions.assertTrue;
9+
import org.junit.jupiter.api.Test;
1110

1211
class DateExampleTest {
1312

@@ -48,13 +47,14 @@ void testSimpleDateForMate() {
4847
long time = 1636201275057L;
4948
Date date = new Date(time);
5049
String formatDate = format.format(date);
51-
assertTrue("2021-11-06 20:21:15".equals(formatDate) || "2021-11-06 12:21:15".equals(formatDate));
50+
assertTrue(
51+
"2021-11-06 20:21:15".equals(formatDate) || "2021-11-06 12:21:15".equals(formatDate));
5252
}
5353

5454
@Test
5555
void testParse() throws ParseException {
5656
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
5757
long time = format.parse("2021-11-06 20:21:15").getTime();
58-
// assertEquals(1636201275057L, time); TODO
58+
// assertEquals(1636201275057L, time); TODO
5959
}
6060
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.examplehub.basics.time;
22

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

55
import java.time.LocalDateTime;
66
import java.time.Month;
77
import java.time.format.DateTimeFormatter;
8-
9-
import static org.junit.jupiter.api.Assertions.*;
8+
import org.junit.jupiter.api.Test;
109

1110
class DateTimeFormatExampleTest {
1211
@Test
@@ -15,4 +14,4 @@ void test() {
1514
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
1615
assertEquals("2099-12-30 23:59:59", formatter.format(localDateTime));
1716
}
18-
}
17+
}

src/test/java/com/examplehub/basics/time/LocalDateTimeExampleTest.java

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

3+
import static org.junit.jupiter.api.Assertions.*;
4+
35
import java.time.LocalDate;
46
import java.time.LocalDateTime;
57
import java.time.LocalTime;
68
import org.junit.jupiter.api.Test;
7-
import static org.junit.jupiter.api.Assertions.*;
89

910
class LocalDateTimeExampleTest {
1011
@Test
@@ -17,7 +18,6 @@ void testInit() {
1718
System.out.println("localDateTime: " + localDateTime);
1819
}
1920

20-
2121
@Test
2222
void testOf() {
2323
LocalDate localDate = LocalDate.of(2019, 11, 30);

0 commit comments

Comments
 (0)