Break up testIdentityToStringStringBuilder into multiple test methods.

This commit is contained in:
Gary Gregory 2017-11-10 11:54:14 -07:00
parent 22c3047156
commit 10122741ea
1 changed files with 10 additions and 2 deletions

View File

@ -216,13 +216,21 @@ public class ObjectUtilsTest {
final Integer i = Integer.valueOf(90);
final String expected = "java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
assertEquals(expected, ObjectUtils.identityToString(i));
final StringBuilder builder = new StringBuilder();
ObjectUtils.identityToString(builder, i);
assertEquals(expected, builder.toString());
}
@Test
public void testIdentityToStringStringBuilderInUse() {
final Integer i = Integer.valueOf(90);
final String expected = "ABC = java.lang.Integer@" + Integer.toHexString(System.identityHashCode(i));
final StringBuilder builder = new StringBuilder("ABC = ");
ObjectUtils.identityToString(builder, i);
assertEquals(expected, builder.toString());
}
@Test
public void testIdentityToStringStringBuilderNullValue() {
try {