@Test public void test_should_nullify_fields() { Role role1 = Role.builder().code("roleCode1").build(); Role role2 = Role.builder().code("roleCode2").build(); User user = User.builder() .username("userName") .mobileNumber("mobileNumber") .password("password") .passwordExpiryDate(new Date()) .roles(new HashSet<>(Arrays.asList(role1, role2))) .build(); user.nullifySensitiveFields(); assertNull(user.getUsername()); assertNull(user.getMobileNumber()); assertNull(user.getPassword()); assertNull(user.getPasswordExpiryDate()); assertNull(user.getRoles()); }
public void nullifySensitiveFields() { username = null; type = null; mobileNumber = null; password = null; passwordExpiryDate = null; roles = null; accountLocked = null; accountLockedDate = null; }
User { public void nullifySensitiveFields() { username = null; type = null; mobileNumber = null; password = null; passwordExpiryDate = null; roles = null; accountLocked = null; accountLockedDate = null; } }
User { public void nullifySensitiveFields() { username = null; type = null; mobileNumber = null; password = null; passwordExpiryDate = null; roles = null; accountLocked = null; accountLockedDate = null; }  }
User { public void nullifySensitiveFields() { username = null; type = null; mobileNumber = null; password = null; passwordExpiryDate = null; roles = null; accountLocked = null; accountLockedDate = null; }  User addAddressItem(Address addressItem); User addRolesItem(Role roleItem); void validateNewUser(); void validateUserModification(); boolean isCorrespondenceAddressInvalid(); boolean isPermanentAddressInvalid(); boolean isOtpReferenceAbsent(); boolean isTypeAbsent(); boolean isActiveIndicatorAbsent(); boolean isMobileNumberAbsent(); boolean isNameAbsent(); boolean isUsernameAbsent(); boolean isTenantIdAbsent(); boolean isPasswordAbsent(); boolean isRolesAbsent(); boolean isIdAbsent(); void nullifySensitiveFields(); boolean isLoggedInUserDifferentFromUpdatedUser(); void setRoleToCitizen(); void updatePassword(String newPassword); OtpValidationRequest getOtpValidationRequest(); List<Address> getPermanentAndCorrespondenceAddresses(); void setDefaultPasswordExpiry(int expiryInDays); void setActive(boolean isActive); }
User { public void nullifySensitiveFields() { username = null; type = null; mobileNumber = null; password = null; passwordExpiryDate = null; roles = null; accountLocked = null; accountLockedDate = null; }  User addAddressItem(Address addressItem); User addRolesItem(Role roleItem); void validateNewUser(); void validateUserModification(); boolean isCorrespondenceAddressInvalid(); boolean isPermanentAddressInvalid(); boolean isOtpReferenceAbsent(); boolean isTypeAbsent(); boolean isActiveIndicatorAbsent(); boolean isMobileNumberAbsent(); boolean isNameAbsent(); boolean isUsernameAbsent(); boolean isTenantIdAbsent(); boolean isPasswordAbsent(); boolean isRolesAbsent(); boolean isIdAbsent(); void nullifySensitiveFields(); boolean isLoggedInUserDifferentFromUpdatedUser(); void setRoleToCitizen(); void updatePassword(String newPassword); OtpValidationRequest getOtpValidationRequest(); List<Address> getPermanentAndCorrespondenceAddresses(); void setDefaultPasswordExpiry(int expiryInDays); void setActive(boolean isActive);  }