1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; import com.ilubov.vo.TestVo; import com.ilubov.util.TopUtil; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner;
@Slf4j @RunWith(SpringRunner.class) @SpringBootTest public class TopTest {
@Test public void test() { // 6 5 2 3 1 7 4 TopUtil.set(new TestVo(1L, 20L, DateUtil.parse("2020-01-02", "yyyy-MM-dd"))); TopUtil.set(new TestVo(2L, 20L, DateUtil.parse("2020-01-03", "yyyy-MM-dd"))); TopUtil.set(new TestVo(3L, 30L, DateUtil.parse("2020-01-02", "yyyy-MM-dd"))); TopUtil.set(new TestVo(4L, 10L, DateUtil.parse("2020-01-02", "yyyy-MM-dd"))); TopUtil.set(new TestVo(5L, 10L, DateUtil.parse("2020-01-04", "yyyy-MM-dd"))); TopUtil.set(new TestVo(6L, 20L, DateUtil.parse("2020-01-04", "yyyy-MM-dd"))); TopUtil.set(new TestVo(7L, 10L, DateUtil.parse("2020-01-02", "yyyy-MM-dd"))); System.out.println(JSON.toJSONString(TopUtil.get(), true)); } }
|