Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
<version>6.46.1</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4</recipe>
<recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5</recipe>
</activeRecipes>
</configuration>
<dependencies>
Expand Down Expand Up @@ -354,7 +354,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.13</version>
<version>3.5.16</version>
<relativePath/>
</parent>
<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/wise/portal/spring/impl/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
@EnableRedisIndexedHttpSession
public class RedisConfig {

@Value("${spring.redis.host}")
@Value("${spring.data.redis.host}")
private String redisHostName;

@Value("${spring.redis.port}")
@Value("${spring.data.redis.port}")
private int redisPort;

@Value("${spring.redis.password:#{null}}")
@Value("${spring.data.redis.password:#{null}}")
private String redisPassword;

@Value("${spring.redis.pool.max.total}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;
import org.springframework.security.web.session.HttpSessionEventPublisher;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
import org.springframework.session.Session;
import org.wise.portal.presentation.web.filters.LoginRedirectUrlParameterFilter;
import org.wise.portal.presentation.web.filters.MicrosoftAuthenticationFailureHandler;
Expand Down Expand Up @@ -182,7 +182,7 @@ public SecurityFilterChain filterChain(HttpSecurity http,
.successHandler(oauth2AuthenticationSuccessHandler())
.failureHandler(oauth2AuthenticationFailureHandler()))
.logout(logout -> logout.addLogoutHandler(wiseLogoutHandler())
.logoutRequestMatcher(new AntPathRequestMatcher("/api/logout"))
.logoutRequestMatcher(PathPatternRequestMatcher.withDefaults().matcher("/api/logout"))
.logoutSuccessHandler((request, response, authentication) -> response
.setStatus(HttpServletResponse.SC_OK)))
.headers(headers -> headers.frameOptions(frame -> frame.sameOrigin()));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-dockerdev-sample.properties
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spring.jpa.properties.hibernate.bytecode.use_reflection_optimizer=true

spring.session.store-type=redis
spring.data.redis.host=wise-redis
#spring.redis.password= # Login password of the redis server.
#spring.data.redis.password= # Login password of the redis server.
spring.data.redis.port=6379
spring.redis.pool.max.total=128
#spring.session.redis.flush-mode=on-save # Sessions flush mode.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application_sample.properties
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spring.jpa.properties.hibernate.bytecode.use_reflection_optimizer=true

spring.session.store-type=redis
spring.data.redis.host=localhost
#spring.redis.password= # Login password of the redis server.
#spring.data.redis.password= # Login password of the redis server.
spring.data.redis.port=6379
spring.redis.pool.max.total=128
#spring.session.redis.flush-mode=on-save # Sessions flush mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public abstract class AbstractTransactionalDbTests
static void redisProperties(DynamicPropertyRegistry registry) {
String redisHost = redisContainer.getHost();
Integer redisPort = redisContainer.getFirstMappedPort();
registry.add("spring.redis.host", () -> redisHost);
registry.add("spring.redis.port", () -> redisPort);
registry.add("spring.data.redis.host", () -> redisHost);
registry.add("spring.data.redis.port", () -> redisPort);
}

public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static org.easymock.EasyMock.newCapture;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.ArrayList;
import java.util.Date;
Expand All @@ -24,6 +23,7 @@
import org.easymock.EasyMockExtension;
import org.easymock.Mock;
import org.easymock.TestSubject;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -216,4 +216,9 @@ public void launchSurveyRun_NoIssues_RedirectUnit() throws Exception {
surveyAPIController.launchSurveyRun("dog1234-1", httpServletResponse, httpServletRequest);
verify(httpServletResponse, runService, userService, workgroupService, studentService);
}

@AfterEach
public void tearDown() {
SecurityContextHolder.clearContext();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void setUp() {

@AfterEach
public void tearDown() {
SecurityContextHolder.clearContext();
groupAclService = null;
mutableAclService = null;
authority = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public class WebSecurityConfigAuthorizationTest {

@DynamicPropertySource
static void redisProperties(DynamicPropertyRegistry registry) {
registry.add("spring.redis.host", redisContainer::getHost);
registry.add("spring.redis.port", redisContainer::getFirstMappedPort);
registry.add("spring.data.redis.host", redisContainer::getHost);
registry.add("spring.data.redis.port", redisContainer::getFirstMappedPort);
}

@Autowired
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ spring.jpa.hibernate.ddl-auto=create-drop

spring.session.store-type=redis
spring.data.redis.host=localhost
#spring.redis.password= # Login password of the redis server.
#spring.data.redis.password= # Login password of the redis server.
spring.data.redis.port=6379
spring.redis.pool.max.total=128
#spring.session.redis.flush-mode=on-save # Sessions flush mode.
Expand Down
Loading