package com.rj.util;

import org.junit.jupiter.api.Test;

import java.util.LinkedHashMap;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;

class HxrGoodsSignUtilTest {

    @Test
    void computeSign_matchesBrowserDevToolsSample() {
        Map<String, Object> params = new LinkedHashMap<>();
        params.put("page", 11);
        params.put("limit", 20);
        params.put("timestamp", 1779789545L);
        params.put("noncestr", "4s3yi");

        String sign = HxrGoodsSignUtil.computeSign(params, "ssniQQ3UP2Vr8mXwaugssgaOLzQo0cX5");

        assertEquals(
                "b9da2cce2cabf074401de36687dc90669ffe5a9ab9cc841bdaed412a13cbe536",
                sign);
    }
}
