Merge branch 'v5-dev' of https://github.com/totalo/hutool into v5-dev

This commit is contained in:
tangguocheng1
2020-09-22 08:28:13 +08:00
4 changed files with 56 additions and 7 deletions

View File

@@ -819,4 +819,12 @@ public class DateUtilTest {
final DateTime parse = DateUtil.parse(dt);
Assert.assertEquals("2020-06-03 12:32:12", parse.toString());
}
@Test
public void getBetweenMonthsTest() {
List<String> months1 = DateUtil.getBetweenMonths(new Date(), new Date());
Assert.assertEquals(1, months1.size());
List<String> months = DateUtil.getBetweenMonths(DateUtil.parse("2020-05-08 3:12:3"), new Date());
Assert.assertEquals(5, months.size());
}
}

View File

@@ -74,4 +74,9 @@ public class NetUtilTest {
Assert.assertEquals("/", httpCookie.getPath());
Assert.assertEquals("cookiedomain.com", httpCookie.getDomain());
}
@Test
public void getLocalHostNameTest() {
System.out.println(NetUtil.getLocalHostName());
}
}