Skip to content

Commit

Permalink
Merge pull request #13 from wiemanboy/feature/fix-allow-public-data
Browse files Browse the repository at this point in the history
FIX: config now has @configuration annotation so public data should n…
  • Loading branch information
wiemanboy authored Oct 19, 2024
2 parents 93f9d97 + 0eef2f4 commit 2c4f8e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.wiemanboy</groupId>
<artifactId>WiemanApi</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<name>WiemanApi</name>
<description>WiemanApi</description>
<url/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
Expand All @@ -10,7 +11,7 @@
import org.springframework.security.oauth2.jwt.*;
import org.springframework.security.web.SecurityFilterChain;


@Configuration
@EnableWebSecurity
public class SecurityConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.wiemanboy.wiemanapi;

import com.wiemanboy.wiemanapi.config.TestSecurityConfig;
import com.wiemanboy.wiemanapi.config.SecurityConfig;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = {TestSecurityConfig.class, WiemanApiApplication.class})
@SpringBootTest(classes = {SecurityConfig.class, WiemanApiApplication.class})
class WiemanApiApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.wiemanboy.wiemanapi.config;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;

@TestConfiguration
public class TestSecurityConfig {
@Configuration
public class SecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http.authorizeHttpRequests(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.wiemanboy.wiemanapi.WiemanApiApplication;
import com.wiemanboy.wiemanapi.builders.ProfileBuilder;
import com.wiemanboy.wiemanapi.config.TestSecurityConfig;
import com.wiemanboy.wiemanapi.config.SecurityConfig;
import com.wiemanboy.wiemanapi.data.ProfileRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -19,7 +19,7 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@SpringBootTest(classes = {TestSecurityConfig.class, WiemanApiApplication.class})
@SpringBootTest(classes = {SecurityConfig.class, WiemanApiApplication.class})
@AutoConfigureMockMvc
public class ProfileControllerTest {

Expand Down

0 comments on commit 2c4f8e0

Please sign in to comment.