Skip to content

Commit

Permalink
feat: Desabilitando a segurança nos testes para futura implementações.
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacAndra committed Sep 4, 2024
1 parent bd6aeaf commit 67b40f0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/test/java/com/isaacandrade/blog/Auth/TestSecurityConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.isaacandrade.blog.Auth;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;

import org.springframework.security.web.SecurityFilterChain;

@Configuration
@Profile("test")
@EnableWebSecurity
public class TestSecurityConfig{

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{
http.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth -> auth.anyRequest().permitAll());
return http.build();
}

}

0 comments on commit 67b40f0

Please sign in to comment.