|
|
|
@ -937,10 +937,10 @@ class ObjectUtilsTests {
@@ -937,10 +937,10 @@ class ObjectUtilsTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void nullSafeConciseToStringForFile() { |
|
|
|
|
String path = "/tmp/file.txt"; |
|
|
|
|
String path = "/tmp/file.txt".replace('/', File.separatorChar); |
|
|
|
|
assertThat(ObjectUtils.nullSafeConciseToString(new File(path))).isEqualTo(path); |
|
|
|
|
|
|
|
|
|
path = "/tmp/" + "xyz".repeat(32); |
|
|
|
|
path = ("/tmp/" + "xyz".repeat(32)).replace('/', File.separatorChar); |
|
|
|
|
assertThat(ObjectUtils.nullSafeConciseToString(new File(path))) |
|
|
|
|
.hasSize(truncatedLength) |
|
|
|
|
.startsWith(path.subSequence(0, 100)) |
|
|
|
@ -949,10 +949,10 @@ class ObjectUtilsTests {
@@ -949,10 +949,10 @@ class ObjectUtilsTests {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void nullSafeConciseToStringForPath() { |
|
|
|
|
String path = "/tmp/file.txt"; |
|
|
|
|
String path = "/tmp/file.txt".replace('/', File.separatorChar); |
|
|
|
|
assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path))).isEqualTo(path); |
|
|
|
|
|
|
|
|
|
path = "/tmp/" + "xyz".repeat(32); |
|
|
|
|
path = ("/tmp/" + "xyz".repeat(32)).replace('/', File.separatorChar); |
|
|
|
|
assertThat(ObjectUtils.nullSafeConciseToString(Path.of(path))) |
|
|
|
|
.hasSize(truncatedLength) |
|
|
|
|
.startsWith(path.subSequence(0, 100)) |
|
|
|
|