|
1 | | -package io.github.linyimin0812.async.listener |
2 | | - |
3 | | -import org.springframework.beans.factory.annotation.Autowired |
4 | | -import org.springframework.context.ApplicationContext |
5 | | -import org.springframework.core.Ordered |
6 | | -import org.springframework.test.context.ContextConfiguration |
7 | | -import spock.lang.Specification |
8 | | - |
9 | | - |
10 | | -/** |
11 | | - * @author linyimin |
12 | | - * */ |
13 | | -@ContextConfiguration("classpath:bean-context.xml") |
14 | | -class AsyncTaskExecutionListenerSpec extends Specification { |
15 | | - |
16 | | - @Autowired |
17 | | - private ApplicationContext applicationContext |
18 | | - |
19 | | - def "test setApplicationContext"() { |
20 | | - when: |
21 | | - AsyncTaskExecutionListener listener = applicationContext.getBean(AsyncTaskExecutionListener.class) |
22 | | - |
23 | | - then: |
24 | | - listener.getApplicationContext() != null |
25 | | - } |
26 | | - |
27 | | - def "test getOrder"() { |
28 | | - when: |
29 | | - AsyncTaskExecutionListener listener = new AsyncTaskExecutionListener() |
30 | | - |
31 | | - then: |
32 | | - listener.getOrder() == Ordered.HIGHEST_PRECEDENCE |
33 | | - } |
34 | | -} |
| 1 | +//package io.github.linyimin0812.async.listener |
| 2 | +// |
| 3 | +//import org.springframework.beans.factory.annotation.Autowired |
| 4 | +//import org.springframework.context.ApplicationContext |
| 5 | +//import org.springframework.core.Ordered |
| 6 | +//import org.springframework.test.context.ContextConfiguration |
| 7 | +//import spock.lang.Specification |
| 8 | +// |
| 9 | +// |
| 10 | +///** |
| 11 | +// * @author linyimin |
| 12 | +// * */ |
| 13 | +//@ContextConfiguration("classpath:bean-context.xml") |
| 14 | +//class AsyncTaskExecutionListenerSpec extends Specification { |
| 15 | +// |
| 16 | +// @Autowired |
| 17 | +// private ApplicationContext applicationContext |
| 18 | +// |
| 19 | +// def "test setApplicationContext"() { |
| 20 | +// when: |
| 21 | +// AsyncTaskExecutionListener listener = applicationContext.getBean(AsyncTaskExecutionListener.class) |
| 22 | +// |
| 23 | +// then: |
| 24 | +// listener.getApplicationContext() != null |
| 25 | +// } |
| 26 | +// |
| 27 | +// def "test getOrder"() { |
| 28 | +// when: |
| 29 | +// AsyncTaskExecutionListener listener = new AsyncTaskExecutionListener() |
| 30 | +// |
| 31 | +// then: |
| 32 | +// listener.getOrder() == Ordered.HIGHEST_PRECEDENCE |
| 33 | +// } |
| 34 | +//} |
0 commit comments