title: Spring boot Http Security config unit test
body: <p>In My Spring boot application, I have a security config class for which I am trying to write a unit test for. This is my first time doing it so I need some assistance.  Here is the code below. Please some help would be much appreciated. Thank you</p>
  
  <pre><code>public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
  private String id;
  private String pwd;
  private String role;
  
  @Autowired
  private AuthenticationEntryPoint authEntryPoint;
  
  @Override
  protected void configure(HttpSecurity http) throws Exception {
      http.csrf().disable().authorizeRequests()
              .anyRequest().authenticated()
              .and().httpBasic()
              .authenticationEntryPoint(authEntryPoint).and()
              .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
  
      //This allows to view h2 console during development
      http.headers().frameOptions().sameOrigin();
  }
  
  @Autowired
  public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
      auth.inMemoryAuthentication().
              withUser(id).
              password(pwd).
              roles(role);
  }}
  </code></pre>