How to write JUnit for addInterceptors method of WebMvcConfigurerAdapter?

Below is my class:

@Configuration
@EnableWebMvc
@ComponentScan(basePackages = { "com.abc" })
public class MyAdapter extends WebMvcConfigurerAdapter  {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        
        registry.addInterceptor(new BasicInterceptor());
        
    }
    
}

I referred some of the stackoverflow threads and ended up getting confused. I am using JUnit 4 in my project with no access to JUnit 5.



Read more here: https://stackoverflow.com/questions/66997733/how-to-write-junit-for-addinterceptors-method-of-webmvcconfigureradapter

Content Attribution

This content was originally published by Coder17 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: