Closed arminrosu closed 7 years ago
@arminrosu your bug doesn't reproduce. The code works as expected without any exceptions:
@Test
public void shouldReturnEmptyUserName() {
UserProfileBuilder userProfileBuilder = new UserProfileBuilder().setName("");
UserProfile user = userProfileBuilder.build();
assertEquals("", user.getFirstName());
assertNull(user.getLastName());
}
That seems right. Wondering how the error appeared. Closing for now as it seems to not apply. Thanks @AndriyBrez
Summary
UserProfileBuilder throws an error when trying to create a profile with an empty string
""
as a name.Actual Behavior
java.lang.ArrayIndexOutOfBoundsException: 0
This error is caused by this line.
Expected Behavior
It should return a profile with an empty firstName and empty lastName, as it does when setting the name to
null
.Configuration
Default
Version
Latest
Sample