User extends GeonetEntity implements UserDetails { public @Nonnull UserSecurity getSecurity() { return _security; }  static String getRandomPassword(); @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = ID_SEQ_NAME) int getId(); @Nonnull User setId(int id); @Column(nullable = false, unique = true) @Nonnull String getUsername(); @Nonnull User setUsername(@Nonnull String username); @Transient @Override @JsonIgnore String getPassword(); @Nullable String getSurname(); @Nonnull User setSurname(@Nullable String surname); @Nullable String getName(); @Nonnull User setName(@Nullable String name); @Transient String getEmail(); @ElementCollection(fetch = FetchType.EAGER, targetClass = String.class) @CollectionTable(name = "email") @Column(name = "email") Set<String> getEmailAddresses(); User setEmailAddresses(Set<String> email); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true) @JoinTable(name = "UserAddress", joinColumns = @JoinColumn(name = "userid"), inverseJoinColumns = {@JoinColumn(name = "addressid", referencedColumnName = "ID", unique = true)}) Set<Address> getAddresses(); @Transient @Nonnull Address getPrimaryAddress(); String getOrganisation(); User setOrganisation(String organization); @Column(length = 16) String getKind(); @Nonnull User setKind(String kind); @Column(nullable = false) @Nonnull Profile getProfile(); @Nonnull User setProfile(@Nonnull Profile profile); @Nonnull UserSecurity getSecurity(); @Nullable String getLastLoginDate(); @Nonnull User setLastLoginDate(@Nullable String lastLoginDate); @Transient @Override Collection<GrantedAuthority> getAuthorities(); @Transient @Override boolean isAccountNonExpired(); @Transient @Override boolean isAccountNonLocked(); @Override @Transient boolean isCredentialsNonExpired(); @Column(name = "isenabled", nullable = false, length = 1, columnDefinition="CHAR(1) DEFAULT 'y'") @Convert(converter = BooleanToYNConverter.class) @Override boolean isEnabled(); User setEnabled(Boolean enabled); void mergeUser(User otherUser, boolean mergeNullData); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static final String NODE_APPLICATION_CONTEXT_KEY; }
@Test public void testSetSecurityNotifications() throws Exception { final User user = UserRepositoryTest.newUser(_inc); user.getSecurity().setSecurityNotificationsString(""); assertTrue(user.getSecurity().getSecurityNotifications().isEmpty()); }