RetryServiceTest.java
803 Bytes
package cn.com.glsx.notify.modules.service;
import cn.com.glsx.Application;
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.SpringRunner;
/**
* spring boot 重试机制测试类
*/
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class RetryServiceTest {
@Autowired
private RetryService retryService;
@Test
public void retryTest() {
//int count = retryService.retry(-1);
retryService.devide(-1, 0);
//logger.info("库存为:" + count);
}
}