Skip to content

Commit

Permalink
[FEAT] 테스트 코드 실행 시 csrf 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
bbabbi committed Dec 24, 2024
1 parent ed63b11 commit b2a4fb0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/java/org/vsa/server/ServerApplicationTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.vsa.server;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;

@SpringBootTest
class ServerApplicationTests {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.csrf(csrf -> csrf.disable())
.authorizeHttpRequests(auth -> auth
.anyRequest().permitAll()
);

return http.build();
}

@Test
void contextLoads() {
}

}

0 comments on commit b2a4fb0

Please sign in to comment.