Upgrade to Spring Boot 4.0.1.
This commit is contained in:
parent
91168d69cb
commit
b714593194
10
build.gradle
10
build.gradle
@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.5.9'
|
||||
id 'org.springframework.boot' version '4.0.1'
|
||||
id 'io.spring.dependency-management' version '1.1.7'
|
||||
}
|
||||
|
||||
@ -47,9 +47,11 @@ dependencies {
|
||||
// From Spring Initalizr
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-jackson'
|
||||
runtimeOnly 'com.mysql:mysql-connector-j'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-jackson-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
|
||||
@ -60,7 +62,7 @@ dependencies {
|
||||
|
||||
implementation 'org.commonmark:commonmark:0.27.0'
|
||||
implementation 'org.jsoup:jsoup:1.21.2'
|
||||
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.20.1'
|
||||
implementation 'tools.jackson.dataformat:jackson-dataformat-yaml:3.0.3'
|
||||
|
||||
implementation 'io.minio:minio:8.6.0'
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@ -3,18 +3,18 @@ package app.mealsmadeeasy.api.auth;
|
||||
import app.mealsmadeeasy.api.user.User;
|
||||
import app.mealsmadeeasy.api.user.UserCreateException;
|
||||
import app.mealsmadeeasy.api.user.UserService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.servlet.http.Cookie;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.MvcResult;
|
||||
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -46,7 +46,7 @@ public class AuthControllerTests {
|
||||
}
|
||||
}
|
||||
|
||||
private MockHttpServletRequestBuilder getLoginRequest() throws Exception {
|
||||
private MockHttpServletRequestBuilder getLoginRequest() {
|
||||
final Map<String, ?> body = Map.of(
|
||||
"username", "test",
|
||||
"password", "test"
|
||||
|
||||
@ -8,11 +8,10 @@ import app.mealsmadeeasy.api.image.spec.ImageUpdateInfoSpec;
|
||||
import app.mealsmadeeasy.api.user.User;
|
||||
import app.mealsmadeeasy.api.user.UserCreateException;
|
||||
import app.mealsmadeeasy.api.user.UserService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
@ -23,6 +22,7 @@ import org.testcontainers.containers.MinIOContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@ -13,12 +13,10 @@ import app.mealsmadeeasy.api.recipe.star.RecipeStarService;
|
||||
import app.mealsmadeeasy.api.user.User;
|
||||
import app.mealsmadeeasy.api.user.UserCreateException;
|
||||
import app.mealsmadeeasy.api.user.UserService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.DynamicPropertyRegistry;
|
||||
@ -28,6 +26,7 @@ import org.testcontainers.containers.MinIOContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
@ -242,7 +241,7 @@ public class RecipeControllerTests {
|
||||
.andExpect(jsonPath("$.content", hasSize(3)));
|
||||
}
|
||||
|
||||
private String getUpdateBody() throws JsonProcessingException {
|
||||
private String getUpdateBody() {
|
||||
final RecipeUpdateSpec spec = new RecipeUpdateSpec();
|
||||
spec.setTitle("Updated Test Recipe");
|
||||
spec.setPreparationTime(15);
|
||||
|
||||
@ -2,17 +2,16 @@ package app.mealsmadeeasy.api.signup;
|
||||
|
||||
import app.mealsmadeeasy.api.user.UserCreateException.Type;
|
||||
import app.mealsmadeeasy.api.user.UserService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -34,8 +33,7 @@ public class SignUpControllerTests {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
private MockHttpServletRequestBuilder getCheckUsernameRequest(String usernameToCheck)
|
||||
throws JsonProcessingException {
|
||||
private MockHttpServletRequestBuilder getCheckUsernameRequest(String usernameToCheck) {
|
||||
final Map<String, Object> body = Map.of("username", usernameToCheck);
|
||||
return MockMvcRequestBuilders.get("/sign-up/check-username")
|
||||
.content(this.objectMapper.writeValueAsString(body))
|
||||
@ -60,7 +58,7 @@ public class SignUpControllerTests {
|
||||
}
|
||||
|
||||
|
||||
private MockHttpServletRequestBuilder getCheckEmailRequest(String emailToCheck) throws JsonProcessingException {
|
||||
private MockHttpServletRequestBuilder getCheckEmailRequest(String emailToCheck) {
|
||||
final Map<String, Object> body = Map.of("email", emailToCheck);
|
||||
return MockMvcRequestBuilders.get("/sign-up/check-email")
|
||||
.content(this.objectMapper.writeValueAsString(body))
|
||||
|
||||
@ -8,14 +8,14 @@ import app.mealsmadeeasy.api.recipe.RecipeService;
|
||||
import app.mealsmadeeasy.api.recipe.spec.RecipeCreateSpec;
|
||||
import app.mealsmadeeasy.api.user.User;
|
||||
import app.mealsmadeeasy.api.user.UserService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
import tools.jackson.dataformat.yaml.YAMLFactory;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package app.mealsmadeeasy.api.security;
|
||||
|
||||
import app.mealsmadeeasy.api.jwt.JwtService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import io.jsonwebtoken.JwtException;
|
||||
import jakarta.servlet.FilterChain;
|
||||
@ -19,6 +18,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ public class SecurityConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception {
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) {
|
||||
httpSecurity.authorizeHttpRequests(requests -> requests.anyRequest().permitAll());
|
||||
httpSecurity.csrf(AbstractHttpConfigurer::disable);
|
||||
httpSecurity.cors(Customizer.withDefaults());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user