ebike-plus/ebike-operations/src/test/java/com/cdzy/operations/EbikeOperationsApplicationTests.java

33 lines
788 B
Java
Raw Normal View History

2025-09-15 15:48:54 +08:00
package com.cdzy.operations;
2025-09-15 10:36:01 +08:00
import com.cdzy.operations.utils.RedisUtil;
import com.mybatisflex.core.keygen.impl.SnowFlakeIDKeyGenerator;
import jakarta.annotation.Resource;
2025-09-15 10:36:01 +08:00
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.concurrent.TimeUnit;
2025-11-17 16:00:56 +08:00
2025-09-15 10:36:01 +08:00
@SpringBootTest
class EbikeOperationsApplicationTests {
@Resource
RedisUtil redisUtil;
2025-09-15 10:36:01 +08:00
@Test
2025-11-27 15:22:19 +08:00
void contextLoads(){
SnowFlakeIDKeyGenerator generator = new SnowFlakeIDKeyGenerator();
long nextId = generator.nextId();
2025-11-27 15:22:19 +08:00
redisUtil.saveDispatchOrder(nextId, "2", 5L, TimeUnit.MINUTES);
System.out.println(nextId);
}
@Test
2025-11-27 15:22:19 +08:00
void deleteDispatchOrder(){
redisUtil.deleteDispatchOrder(351467314753310720L);
2025-09-15 10:36:01 +08:00
}
2025-09-15 10:36:01 +08:00
}