package com.ruoyi.web.modules.screen.mallstats;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("MallStatsOpenTokenSupport")
class MallStatsOpenTokenSupportTest
{
    @Test
    @DisplayName("生成 Token 非空且为 Base64")
    void createToken_ok()
    {
        MallStatsOpenProperties properties = new MallStatsOpenProperties();
        properties.setAesKey("mdYJB5ENzTwEbql2");
        properties.setAesIv("FU2GR30Iw76PjXbO");
        String token = new MallStatsOpenTokenSupport().createToken(properties);
        assertNotNull(token);
        assertTrue(token.length() > 8);
    }
}
