@Test public void testUsernameIsTrimmed() { User user = new User(" user "); assertThat(user.getUsername(), equalTo("user")); }
@Column(unique = true) public String getUsername() { return username; }
User implements UserDetails, Identifiable<Long> { @Column(unique = true) public String getUsername() { return username; } }
User implements UserDetails, Identifiable<Long> { @Column(unique = true) public String getUsername() { return username; } User();  User(String username); }
User implements UserDetails, Identifiable<Long> { @Column(unique = true) public String getUsername() { return username; } User();  User(String username); @Id @GeneratedValue Long getId(); void setId(Long id); @Override boolean isAccountNonExpired(); void setAccountNonExpired(boolean accountNonExpired); @Override boolean isAccountNonLocked(); void setAccountNonLocked(boolean accountNonLocked); @Override boolean isCredentialsNonExpired(); void setCredentialsNonExpired(boolean credentialsNonExpired); @Override boolean isEnabled(); void setEnabled(boolean enabled); @Column(unique = true) String getUsername(); void setUsername(String username); @Override @ManyToMany(fetch = FetchType.EAGER) Collection<Authority> getAuthorities(); String getPassword(); @Transient void setUnencryptedPassword(String password); void addAuthority(Authority authority); String getRememberMeToken(); void setRememberMeToken(String rememberMeToken); @Column(unique = true, name = "CONFIRMATION_TOKEN") String getRegistrationConfirmationToken(); LocalDate getRegistrationDate(); void setRegistrationDate(LocalDate registrationDate); LocalDateTime getLastLogin(); void setLastLogin(LocalDateTime lastLogin); String getEmail(); void setEmail(String email); LocalDateTime getLastModified(); void setLastModified(LocalDateTime lastModified); Long getVersion(); void setVersion(Long version); boolean hasAuthority(String authority); boolean hasAuthority(Authority authority); String createRegistrationConfirmationToken(); void clearRegistrationConfirmationToken(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); void clearPassword(); }
User implements UserDetails, Identifiable<Long> { @Column(unique = true) public String getUsername() { return username; } User();  User(String username); @Id @GeneratedValue Long getId(); void setId(Long id); @Override boolean isAccountNonExpired(); void setAccountNonExpired(boolean accountNonExpired); @Override boolean isAccountNonLocked(); void setAccountNonLocked(boolean accountNonLocked); @Override boolean isCredentialsNonExpired(); void setCredentialsNonExpired(boolean credentialsNonExpired); @Override boolean isEnabled(); void setEnabled(boolean enabled); @Column(unique = true) String getUsername(); void setUsername(String username); @Override @ManyToMany(fetch = FetchType.EAGER) Collection<Authority> getAuthorities(); String getPassword(); @Transient void setUnencryptedPassword(String password); void addAuthority(Authority authority); String getRememberMeToken(); void setRememberMeToken(String rememberMeToken); @Column(unique = true, name = "CONFIRMATION_TOKEN") String getRegistrationConfirmationToken(); LocalDate getRegistrationDate(); void setRegistrationDate(LocalDate registrationDate); LocalDateTime getLastLogin(); void setLastLogin(LocalDateTime lastLogin); String getEmail(); void setEmail(String email); LocalDateTime getLastModified(); void setLastModified(LocalDateTime lastModified); Long getVersion(); void setVersion(Long version); boolean hasAuthority(String authority); boolean hasAuthority(Authority authority); String createRegistrationConfirmationToken(); void clearRegistrationConfirmationToken(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); void clearPassword();  }