Created by zl on 2019/03/01.
| 7 | * Created by zl on 2019/03/01. |
| 8 | */ |
| 9 | public class UserService { |
| 10 | private Map<String,String> users = new ConcurrentHashMap<>(); |
| 11 | private Map<String,String> online = new ConcurrentHashMap<>(); |
| 12 | |
| 13 | public UserService(){ |
| 14 | users.put("admin","admin"); |
| 15 | users.put("user1","pwd1"); |
| 16 | } |
| 17 | |
| 18 | public boolean login(String username,String password){ |
| 19 | if(users.containsKey(username) && users.get(username).equals(password)){ |
| 20 | online.put(username,""); |
| 21 | return true; |
| 22 | } |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | } |
nothing calls this directly
no outgoing calls
no test coverage detected