package com.app;

import com.app.util.id.SnowflakeIdGenerate;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class ApplicationTest {

    @Autowired
    private SnowflakeIdGenerate snowflakeIdGenerate;

    @Test
    public void testSnowflakeIdGenerate() {
        for (int i = 0; i < 40; i++) {
            log.info("id：{}", snowflakeIdGenerate.nextId());
        }
    }

}
