Skip to content

x OBSOLETE (v1.x) Stub Configuration, Interceptors

Tamás Kőhegyi edited this page Jun 21, 2022 · 1 revision

What are the interceptors?

Interceptors are classes those intercept either requests or responses (or both) and do whatever they would like to do with the intercepted messages. See how to use such interceptor classes in the stub configuration file below.


Element: interceptors This element is optional in the stub configuration. If exists, only a single element is acceptable. Under this element the user can define the used interceptors.

<interceptors>
    1..N: | <interceptor... />
</interceptors>

Element: interceptor

An interceptor element holds the definition of a custom interceptor with its own parameters. An interceptor class must implement com.epam.wilma.domain.stubconfig.interceptor.RequestInterceptor or com.epam.wilma.domain.stubconfig.interceptor.ResponseInterceptor or both. If the given class implements both interfaces then both the request and the response will be available for the interceptor class.

<interceptor name="CUSTOM_NAME" class="InterceptorClass">
    <param .../>
    <param .../>
</interceptor>

Examples

You may find some example interceptor classes here as part of the Wilma functional tests.