class JwtToken {

    public String generateToken(AccountInfo accountInfo) {
        return Jwts.builder()
                .claim("salt", SALT)
                .claim("userinfo", JacksonUtil.serialize(accountInfo))
                .setSubject(accountInfo.getAccount())
                .setExpiration(new Date(System.currentTimeMillis() + EXPIRE))
                .signWith(key).compact();
    }

}

class JwtTokenTest {

    private final static Key key;

    @Test
    public void generateTokenTest() {

        JwtToken jwtToken = new JwtToken();
        AccountInfo accountInfo = new AccountInfo();
        accountInfo.setAccount("admin");
        accountInfo.setTeamId(1L);
        String token = jwtToken.generateToken(accountInfo);
    }

}