From bc86e3b3a3327d0c060517c096720fab01cae3e3 Mon Sep 17 00:00:00 2001 From: Devon Hillard Date: Wed, 7 Jan 2026 10:30:47 -0700 Subject: [PATCH 1/2] chore(deps): update dependencies to latest versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update project dependencies: - Spring Boot: 4.0.0 → 4.0.1 - ds-spring-user-framework: 4.0.0 → 4.0.1 - com.github.ben-manes.versions: 0.52.0 → 0.53.0 - mariadb-java-client: 3.5.5 → 3.5.7 - guava: 33.4.8-jre → 33.5.0-jre - h2: 2.3.232 → 2.4.240 - selenide: 7.10.0 → 7.13.0 - webdrivermanager: 6.3.1 → 6.3.3 Also removes deprecated bootJar launchScript configuration that was removed in Spring Boot 4. --- build.gradle | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index af82c85..7a759ec 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java' - id 'org.springframework.boot' version '4.0.0' + id 'org.springframework.boot' version '4.0.1' id 'io.spring.dependency-management' version '1.1.7' - id "com.github.ben-manes.versions" version "0.52.0" + id "com.github.ben-manes.versions" version "0.53.0" } @@ -39,7 +39,7 @@ repositories { dependencies { // DigitalSanctuary Spring User Framework - implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.0' + implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.1' // Spring Boot starters implementation 'org.springframework.boot:spring-boot-starter-actuator' @@ -60,12 +60,12 @@ dependencies { // Runtime dependencies runtimeOnly 'org.springframework.boot:spring-boot-devtools' - runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.5' + runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.7' runtimeOnly 'org.postgresql:postgresql' // Utility libraries implementation 'org.passay:passay:1.6.6' - implementation 'com.google.guava:guava:33.4.8-jre' + implementation 'com.google.guava:guava:33.5.0-jre' implementation 'jakarta.validation:jakarta.validation-api:3.1.1' implementation 'org.hibernate.validator:hibernate-validator:8.0.2.Final' @@ -82,9 +82,9 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-webmvc-test' testImplementation 'org.springframework.boot:spring-boot-starter-security-test' testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'com.h2database:h2:2.3.232' - testImplementation 'com.codeborne:selenide:7.10.0' - testImplementation 'io.github.bonigarcia:webdrivermanager:6.3.1' + testImplementation 'com.h2database:h2:2.4.240' + testImplementation 'com.codeborne:selenide:7.13.0' + testImplementation 'io.github.bonigarcia:webdrivermanager:6.3.3' // OAuth2 Testing dependencies testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:3.0.1' @@ -113,11 +113,6 @@ tasks.register('uiTest', Test) { shouldRunAfter test } - -bootJar { - // launchScript removed in Spring Boot 4 - use systemd or other init systems instead -} - bootRun { // Use Spring Boot DevTool only when we run Gradle bootRun task classpath = sourceSets.main.runtimeClasspath + configurations.developmentOnly From 5098f824698a607d71c9ef477067f1e188571e42 Mon Sep 17 00:00:00 2001 From: Devon Hillard Date: Wed, 7 Jan 2026 10:30:56 -0700 Subject: [PATCH 2/2] fix(test): use dynamic dates in AdminRoleAccessControlTest Replace hardcoded date strings with dynamically generated future dates to prevent test failures when dates pass. The tests were using hardcoded date "2025-12-31" which failed validation against @FutureOrPresent constraint after that date passed. Added a futureDate() helper method that returns LocalDate.now().plusYears(1) to ensure dates are always valid. --- .../concurrent/AdminRoleAccessControlTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/digitalsanctuary/spring/user/concurrent/AdminRoleAccessControlTest.java b/src/test/java/com/digitalsanctuary/spring/user/concurrent/AdminRoleAccessControlTest.java index c9e46b8..c8cf77b 100644 --- a/src/test/java/com/digitalsanctuary/spring/user/concurrent/AdminRoleAccessControlTest.java +++ b/src/test/java/com/digitalsanctuary/spring/user/concurrent/AdminRoleAccessControlTest.java @@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.digitalsanctuary.spring.demo.UserDemoApplication; +import java.time.LocalDate; import com.digitalsanctuary.spring.user.persistence.model.Role; import com.digitalsanctuary.spring.user.persistence.repository.RoleRepository; import com.digitalsanctuary.spring.user.test.annotations.IntegrationTest; @@ -51,6 +52,11 @@ class AdminRoleAccessControlTest { private TestUserManager userManager; private static final String TEST_PREFIX = "role.access"; + /** Returns a date one year in the future to satisfy @FutureOrPresent validation */ + private static String futureDate() { + return LocalDate.now().plusYears(1).toString(); + } + @BeforeEach void setUp() { String uniquePrefix = TEST_PREFIX + "." + System.currentTimeMillis(); @@ -122,7 +128,7 @@ class EventAccessControlTests { @DisplayName("Admin can perform all event operations") void testAdminEventOperations() throws Exception { // Admin can create events - String validEventJson = "{\"name\": \"Admin Event\", \"description\": \"Created by admin\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}"; + String validEventJson = "{\"name\": \"Admin Event\", \"description\": \"Created by admin\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}"; mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON) .content(validEventJson).with(csrf())).andExpect(status().isOk()); } @@ -132,7 +138,7 @@ void testAdminEventOperations() throws Exception { @DisplayName("Regular user can only register for events") void testUserEventLimitations() throws Exception { // User CANNOT create events - String validEventJson = "{\"name\": \"User Event\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}"; + String validEventJson = "{\"name\": \"User Event\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}"; mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON) .content(validEventJson).with(csrf())).andExpect(status().isForbidden()); } @@ -141,7 +147,7 @@ void testUserEventLimitations() throws Exception { @WithMockUser(authorities = {}) @DisplayName("No authorities should deny access") void testNoAuthoritiesAccess() throws Exception { - String validEventJson = "{\"name\": \"Unauthorized\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}"; + String validEventJson = "{\"name\": \"Unauthorized\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}"; mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON) .content(validEventJson).with(csrf())).andExpect(status().isForbidden()); } @@ -180,7 +186,7 @@ void testMultiplePermissionLevels() { @DisplayName("Partial admin permissions should work correctly") void testPartialAdminPermissions() throws Exception { // User with some admin privileges can create events - String validEventJson = "{\"name\": \"Partial Admin Event\", \"description\": \"Test\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}"; + String validEventJson = "{\"name\": \"Partial Admin Event\", \"description\": \"Test\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}"; mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON) .content(validEventJson).with(csrf())).andExpect(status().isOk()); }