use of org.talend.esb.policy.compression.feature.CompressionFeature in project tesb-rt-se by Talend.
the class CompressionFeatureTest method removeInterceptors.
@Test
public void removeInterceptors() {
final List<Interceptor<? extends Message>> outInterceptors = new ArrayList<Interceptor<? extends Message>>();
outInterceptors.add(new CompressionOutInterceptor());
outInterceptors.add(new CompressionOutInterceptor());
final List<Interceptor<? extends Message>> outFaultInterceptors = new ArrayList<Interceptor<? extends Message>>();
outFaultInterceptors.add(new CompressionOutInterceptor());
outFaultInterceptors.add(new CompressionOutInterceptor());
final List<Interceptor<? extends Message>> inInterceptors = new ArrayList<Interceptor<? extends Message>>();
inInterceptors.add(new CompressionInInterceptor());
final List<Interceptor<? extends Message>> inFaultInterceptors = new ArrayList<Interceptor<? extends Message>>();
inFaultInterceptors.add(new CompressionInInterceptor());
InterceptorProvider interceptorProvider = new InterceptorProvider() {
@Override
public List<Interceptor<? extends Message>> getOutInterceptors() {
return outInterceptors;
}
@Override
public List<Interceptor<? extends Message>> getOutFaultInterceptors() {
return outFaultInterceptors;
}
@Override
public List<Interceptor<? extends Message>> getInInterceptors() {
return inInterceptors;
}
@Override
public List<Interceptor<? extends Message>> getInFaultInterceptors() {
return inFaultInterceptors;
}
};
CompressionFeature f = new CompressionFeature();
f.initialize(interceptorProvider, null);
assertTrue(outInterceptors.size() == 1);
assertTrue(outFaultInterceptors.size() == 1);
assertTrue(inInterceptors.size() == 2);
assertTrue(inFaultInterceptors.size() == 1);
}
Aggregations