Class TestSecurityConfig

java.lang.Object
me.josephsf.jobportaljosephsfeirtest.config.TestSecurityConfig

@TestConfiguration public class TestSecurityConfig extends Object
Test configuration for security settings in integration tests. This configuration disables CSRF protection for tests and sets up a mock authentication context with the RECRUITER role.
  • Constructor Details

    • TestSecurityConfig

      public TestSecurityConfig()
  • Method Details

    • testSecurityFilterChain

      @Bean public org.springframework.security.web.SecurityFilterChain testSecurityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Throws:
      Exception
    • passwordEncoder

      @Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
    • setUpRecruiterAuthentication

      public void setUpRecruiterAuthentication()
      Sets up a mock authentication context with a user having the RECRUITER role.