Search in sources :

Example 1 with InterceptorRegistry

use of org.springframework.web.servlet.config.annotation.InterceptorRegistry in project coffeenet-starter by coffeenet.

the class CoffeeNetWebMvcConfigurerAdapterTest method addInterceptors.

@Test
public void addInterceptors() throws Exception {
    InterceptorRegistry interceptorRegistryMock = mock(InterceptorRegistry.class);
    InterceptorRegistration interceptorRegistrationMock = mock(InterceptorRegistration.class);
    when(interceptorRegistryMock.addInterceptor(coffeeNetWebInterceptorMock)).thenReturn(interceptorRegistrationMock);
    sut.addInterceptors(interceptorRegistryMock);
    verify(interceptorRegistryMock).addInterceptor(coffeeNetWebInterceptorMock);
    verify(interceptorRegistrationMock).addPathPatterns("/**");
}
Also used : InterceptorRegistry(org.springframework.web.servlet.config.annotation.InterceptorRegistry) InterceptorRegistration(org.springframework.web.servlet.config.annotation.InterceptorRegistration) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 InterceptorRegistration (org.springframework.web.servlet.config.annotation.InterceptorRegistration)1 InterceptorRegistry (org.springframework.web.servlet.config.annotation.InterceptorRegistry)1