Skip to content

Commit 2aa2eac

Browse files
authored
Merge pull request #48 from devondragon/fix/dependency-updates-and-test-dates
Update dependencies and fix test date validation
2 parents b7d90f3 + 5098f82 commit 2aa2eac

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

build.gradle

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '4.0.0'
3+
id 'org.springframework.boot' version '4.0.1'
44
id 'io.spring.dependency-management' version '1.1.7'
5-
id "com.github.ben-manes.versions" version "0.52.0"
5+
id "com.github.ben-manes.versions" version "0.53.0"
66

77
}
88

@@ -39,7 +39,7 @@ repositories {
3939

4040
dependencies {
4141
// DigitalSanctuary Spring User Framework
42-
implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.0'
42+
implementation 'com.digitalsanctuary:ds-spring-user-framework:4.0.1'
4343

4444
// Spring Boot starters
4545
implementation 'org.springframework.boot:spring-boot-starter-actuator'
@@ -60,12 +60,12 @@ dependencies {
6060

6161
// Runtime dependencies
6262
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
63-
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.5'
63+
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.5.7'
6464
runtimeOnly 'org.postgresql:postgresql'
6565

6666
// Utility libraries
6767
implementation 'org.passay:passay:1.6.6'
68-
implementation 'com.google.guava:guava:33.4.8-jre'
68+
implementation 'com.google.guava:guava:33.5.0-jre'
6969
implementation 'jakarta.validation:jakarta.validation-api:3.1.1'
7070
implementation 'org.hibernate.validator:hibernate-validator:8.0.2.Final'
7171

@@ -82,9 +82,9 @@ dependencies {
8282
testImplementation 'org.springframework.boot:spring-boot-webmvc-test'
8383
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
8484
testImplementation 'org.springframework.security:spring-security-test'
85-
testImplementation 'com.h2database:h2:2.3.232'
86-
testImplementation 'com.codeborne:selenide:7.10.0'
87-
testImplementation 'io.github.bonigarcia:webdrivermanager:6.3.1'
85+
testImplementation 'com.h2database:h2:2.4.240'
86+
testImplementation 'com.codeborne:selenide:7.13.0'
87+
testImplementation 'io.github.bonigarcia:webdrivermanager:6.3.3'
8888

8989
// OAuth2 Testing dependencies
9090
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:3.0.1'
@@ -113,11 +113,6 @@ tasks.register('uiTest', Test) {
113113
shouldRunAfter test
114114
}
115115

116-
117-
bootJar {
118-
// launchScript removed in Spring Boot 4 - use systemd or other init systems instead
119-
}
120-
121116
bootRun {
122117
// Use Spring Boot DevTool only when we run Gradle bootRun task
123118
classpath = sourceSets.main.runtimeClasspath + configurations.developmentOnly

src/test/java/com/digitalsanctuary/spring/user/concurrent/AdminRoleAccessControlTest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.springframework.transaction.annotation.Propagation;
2020
import org.springframework.transaction.annotation.Transactional;
2121
import com.digitalsanctuary.spring.demo.UserDemoApplication;
22+
import java.time.LocalDate;
2223
import com.digitalsanctuary.spring.user.persistence.model.Role;
2324
import com.digitalsanctuary.spring.user.persistence.repository.RoleRepository;
2425
import com.digitalsanctuary.spring.user.test.annotations.IntegrationTest;
@@ -51,6 +52,11 @@ class AdminRoleAccessControlTest {
5152
private TestUserManager userManager;
5253
private static final String TEST_PREFIX = "role.access";
5354

55+
/** Returns a date one year in the future to satisfy @FutureOrPresent validation */
56+
private static String futureDate() {
57+
return LocalDate.now().plusYears(1).toString();
58+
}
59+
5460
@BeforeEach
5561
void setUp() {
5662
String uniquePrefix = TEST_PREFIX + "." + System.currentTimeMillis();
@@ -122,7 +128,7 @@ class EventAccessControlTests {
122128
@DisplayName("Admin can perform all event operations")
123129
void testAdminEventOperations() throws Exception {
124130
// Admin can create events
125-
String validEventJson = "{\"name\": \"Admin Event\", \"description\": \"Created by admin\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}";
131+
String validEventJson = "{\"name\": \"Admin Event\", \"description\": \"Created by admin\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}";
126132
mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON)
127133
.content(validEventJson).with(csrf())).andExpect(status().isOk());
128134
}
@@ -132,7 +138,7 @@ void testAdminEventOperations() throws Exception {
132138
@DisplayName("Regular user can only register for events")
133139
void testUserEventLimitations() throws Exception {
134140
// User CANNOT create events
135-
String validEventJson = "{\"name\": \"User Event\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}";
141+
String validEventJson = "{\"name\": \"User Event\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}";
136142
mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON)
137143
.content(validEventJson).with(csrf())).andExpect(status().isForbidden());
138144
}
@@ -141,7 +147,7 @@ void testUserEventLimitations() throws Exception {
141147
@WithMockUser(authorities = {})
142148
@DisplayName("No authorities should deny access")
143149
void testNoAuthoritiesAccess() throws Exception {
144-
String validEventJson = "{\"name\": \"Unauthorized\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}";
150+
String validEventJson = "{\"name\": \"Unauthorized\", \"description\": \"Should fail\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}";
145151
mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON)
146152
.content(validEventJson).with(csrf())).andExpect(status().isForbidden());
147153
}
@@ -180,7 +186,7 @@ void testMultiplePermissionLevels() {
180186
@DisplayName("Partial admin permissions should work correctly")
181187
void testPartialAdminPermissions() throws Exception {
182188
// User with some admin privileges can create events
183-
String validEventJson = "{\"name\": \"Partial Admin Event\", \"description\": \"Test\", \"location\": \"Test Location\", \"date\": \"2025-12-31\", \"time\": \"14:30\"}";
189+
String validEventJson = "{\"name\": \"Partial Admin Event\", \"description\": \"Test\", \"location\": \"Test Location\", \"date\": \"" + futureDate() + "\", \"time\": \"14:30\"}";
184190
mockMvc.perform(post("/api/events").contentType(MediaType.APPLICATION_JSON)
185191
.content(validEventJson).with(csrf())).andExpect(status().isOk());
186192
}

0 commit comments

Comments
 (0)