• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torresj / community-api / 6

28 May 2025 02:43PM UTC coverage: 75.157% (+53.1%) from 22.105%
6

push

circleci

Jaime Torres Benavente
Security added

87 of 133 new or added lines in 15 files covered. (65.41%)

239 of 318 relevant lines covered (75.16%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/src/main/java/com/torresj/community/security/CustomUserDetails.java
1
package com.torresj.community.security;
2

3
import com.torresj.community.entities.UserEntity;
4
import lombok.RequiredArgsConstructor;
5
import org.springframework.security.core.GrantedAuthority;
6
import org.springframework.security.core.authority.SimpleGrantedAuthority;
7
import org.springframework.security.core.userdetails.UserDetails;
8

9
import java.util.Collection;
10
import java.util.List;
11

12
@RequiredArgsConstructor
13
public class CustomUserDetails implements UserDetails {
14

15
    private final UserEntity userEntity;
16

17
    @Override
18
    public Collection<? extends GrantedAuthority> getAuthorities() {
19
        return List.of(new SimpleGrantedAuthority(userEntity.getRole().name()));
1✔
20
    }
21

22
    @Override
23
    public String getPassword() {
NEW
24
        return userEntity.getPassword();
×
25
    }
26

27
    @Override
28
    public String getUsername() {
29
        return userEntity.getName();
1✔
30
    }
31

32
    @Override
33
    public boolean isAccountNonExpired() {
NEW
34
        return true;
×
35
    }
36

37
    @Override
38
    public boolean isAccountNonLocked() {
NEW
39
        return true;
×
40
    }
41

42
    @Override
43
    public boolean isCredentialsNonExpired() {
NEW
44
        return true;
×
45
    }
46

47
    @Override
48
    public boolean isEnabled() {
NEW
49
        return true;
×
50
    }
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc