public static String createToken(Long id, String username, String role, boolean isRememberMe) {
        long expiration = isRememberMe ? EXPIRATION_REMEMBER : EXPIRATION;
        HashMap<String, Object> map = new HashMap(MAP_INITIAL_CAPACITY);
        map.put(ROLE_CLAIMS, role);
        return Jwts.builder()
                .signWith(SignatureAlgorithm.HS512, SECRET)
                .setClaims(map)
                .setIssuer(ISS)
                .setSubject(id + Constants.SPLIT_COMMA + username)
                .setIssuedAt(new Date())
                .setExpiration(new Date(System.currentTimeMillis() + expiration * Constants.STEP))
                .compact();
    }
@Test
    public void createToken() {
        String name = JwtTokenUtil.getUsername(token);
        Assert.isTrue(username.equals(name));
        Integer userId = JwtTokenUtil.getUserId(token);
        String userRole = JwtTokenUtil.getUserRole(token);
        Assert.isTrue(username.equals(name));
        Assert.isTrue(this.userId.intValue() == userId);
        Assert.isTrue(role.equals(userRole));
    }