User implements Serializable { public String getUserId() { return userId; } User();  User(final String userId);  User(final String userId, final Set<String> dataAuths);  User(final String userId, final Set<String> dataAuths, final Set<String> opAuths); String getUserId(); Set<String> getDataAuths(); Set<String> getOpAuths(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); static final String UNKNOWN_USER_ID; }
@Test public void shouldReplaceNullIdWithUnknownIdWhenBuildingUser() { final String userId = null; final User user = new User.Builder() .userId(userId) .build(); assertEquals(User.UNKNOWN_USER_ID, user.getUserId()); }
@Test public void shouldReplaceEmptyIdWithUnknownIdWhenBuildingUser() { final String userId = ""; final User user = new User.Builder() .userId(userId) .build(); assertEquals(User.UNKNOWN_USER_ID, user.getUserId()); }
@Test public void shouldSetUnknownIdWhenBuildingUser() { final User user = new User.Builder() .build(); assertEquals(User.UNKNOWN_USER_ID, user.getUserId()); }