Skip to content

Commit 2c790c4

Browse files
committed
Refactor LOG
1 parent 1e691b3 commit 2c790c4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎core-java/src/test/java/com/baeldung/dateapi/JavaPeriodTest.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.baeldung.dateapi;
22

3+
import org.apache.log4j.Logger;
4+
import org.junit.Test;
5+
36
import java.time.LocalDate;
47
import java.time.Period;
58

6-
import org.apache.log4j.Logger;
7-
import org.junit.Test;
8-
import static org.junit.Assert.*;
9+
import static org.junit.Assert.assertEquals;
10+
import static org.junit.Assert.assertFalse;
911

1012
public class JavaPeriodTest {
1113

@@ -19,7 +21,7 @@ public void whenTestPeriod_thenOk() {
1921

2022
Period period = Period.between(startDate, endDate);
2123

22-
LOG.info("Years:" + period.getYears() + " months:" + period.getMonths() + " days:" + period.getDays());
24+
LOG.info(String.format("Years:%d months:%d days:%d", period.getYears(), period.getMonths(), period.getDays()));
2325

2426
assertFalse(period.isNegative());
2527
assertEquals(56, period.plusDays(50).getDays());

0 commit comments

Comments
 (0)