Refactor LOG

This commit is contained in:
pivovarit 2017-05-06 21:24:55 +02:00
parent 1e691b3a75
commit 2c790c40cb
1 changed files with 6 additions and 4 deletions

View File

@ -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());