@ruoli
2017-06-21T11:46:55.000000Z
字数 701
阅读 1321
SpringBoot
在 src/test/java 中添加单元测试类,代码如下:
package modules;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = TestApplication.class)
public class AsyncTaskTests{
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
// @Autowired
// private AsyncTask asyncTask;
@Test
public void AsyncTaskTest() throws InterruptedException, ExecutionException {
//asyncTask.doTask1();
logger.info("this is logger");
}
}