How to write JUnit for addInterceptors method of WebMvcConfigurerAdapter?

Below is my class:

@ComponentScan(basePackages = { "" })
public class MyAdapter extends WebMvcConfigurerAdapter  {

    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:

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: