下面是两种加载配置的方式之间的区别:
但是,如果我采用第1种方法,则只有一个拦截器会加载,具体取决于我是调用基于xml的网关还是基于java的网关。
请参考以下链接查看更多信息:https://github.com/manojp1988/Learning/tree/JavaDSL/Sample1
测试类中通过@ContextConfiguration加载两个独立的配置类。
将一个配置导入到另一个配置中,并将其中一个配置加载到测试类的@ContextConfiguration中。
但是,如果我采用第1种方法,则只有一个拦截器会加载,具体取决于我是调用基于xml的网关还是基于java的网关。
请参考以下链接查看更多信息:https://github.com/manojp1988/Learning/tree/JavaDSL/Sample1
@RunWith(SpringJUnit4ClassRunner.class)
@ContextHierarchy({
@ContextConfiguration(locations = {"/applicationContext.xml"}),
@ContextConfiguration(classes = SpringConfiguration.class),
})
public class SampleTest {}
更新:
@Bean
@GlobalChannelInterceptor(patterns = "*_EL*", order=3)
public WireTap wireTap() {