From 2c790c40cbdac1aac107dfb3de83162f50507266 Mon Sep 17 00:00:00 2001 From: pivovarit Date: Sat, 6 May 2017 21:24:55 +0200 Subject: [PATCH] Refactor LOG --- .../test/java/com/baeldung/dateapi/JavaPeriodTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/dateapi/JavaPeriodTest.java b/core-java/src/test/java/com/baeldung/dateapi/JavaPeriodTest.java index 874103389f..a0bede49b5 100644 --- a/core-java/src/test/java/com/baeldung/dateapi/JavaPeriodTest.java +++ b/core-java/src/test/java/com/baeldung/dateapi/JavaPeriodTest.java @@ -1,11 +1,13 @@ package com.baeldung.dateapi; +import org.apache.log4j.Logger; +import org.junit.Test; + import java.time.LocalDate; import java.time.Period; -import org.apache.log4j.Logger; -import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; public class JavaPeriodTest { @@ -19,7 +21,7 @@ public class JavaPeriodTest { Period period = Period.between(startDate, endDate); - LOG.info("Years:" + period.getYears() + " months:" + period.getMonths() + " days:" + period.getDays()); + LOG.info(String.format("Years:%d months:%d days:%d", period.getYears(), period.getMonths(), period.getDays())); assertFalse(period.isNegative()); assertEquals(56, period.plusDays(50).getDays());