Skip to content

Commit

Permalink
Development: Update server dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
krusche committed Nov 19, 2024
1 parent b723b08 commit 9fc102c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
38 changes: 28 additions & 10 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "idea"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "com.github.andygoossens.modernizer" version "1.10.0"
id "org.springframework.boot" version "3.3.5"
id "org.springframework.boot" version "${spring_boot_version}"
id "io.spring.dependency-management" version "1.1.6"
id "com.github.ben-manes.versions" version "0.51.0"
}
Expand Down Expand Up @@ -33,25 +33,43 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"

// Avoid outdated version of netty to prevent security issues
implementation("io.netty:netty-common") {
version {
strictly netty_version
}
}

implementation "org.liquibase:liquibase-core:4.30.0"
implementation "org.postgresql:postgresql"

implementation "commons-io:commons-io:2.17.0"
implementation "commons-io:commons-io:2.18.0"
implementation "com.github.vladimir-bukhtoyarov:bucket4j-core:8.0.1"
implementation "org.mnode.ical4j:ical4j:4.0.5"
implementation "com.itextpdf:itext-core:8.0.5"
implementation "com.itextpdf:html2pdf:5.0.5"
implementation "com.auth0:java-jwt:4.4.0"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testImplementation 'org.mockito:mockito-core:5.14.2'
testImplementation 'org.mockito:mockito-junit-jupiter:5.14.2'
testImplementation 'org.testcontainers:junit-jupiter:1.20.3'
testImplementation 'org.testcontainers:postgresql:1.20.3'
// use newest version of commons-compress to avoid security issues through outdated dependencies
implementation "org.apache.commons:commons-compress:1.27.1"

testImplementation("org.springframework.boot:spring-boot-starter-test:${spring_boot_version}") {
exclude group: "org.junit.vintage", module: "junit-vintage-engine"
exclude group: "com.vaadin.external.google", module: "android-json"
exclude group: "org.xmlunit", module: "xmlunit-core"
}
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.3"
testImplementation "org.mockito:mockito-core:5.14.2"
testImplementation "org.mockito:mockito-junit-jupiter:5.14.2"

testImplementation "org.testcontainers:testcontainers:${testcontainer_version}"
testImplementation "org.testcontainers:junit-jupiter:${testcontainer_version}"
testImplementation "org.testcontainers:jdbc:${testcontainer_version}"
testImplementation "org.testcontainers:database-commons:${testcontainer_version}"
testImplementation "org.testcontainers:postgresql:${testcontainer_version}"

// TODO: for some reason an update of org.junit.jupiter:junit-jupiter-engine to 5.11.x breaks the tests
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.5'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.5"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.11.3"
compileOnly "org.projectlombok:lombok:1.18.36"
annotationProcessor "org.projectlombok:lombok:1.18.36"
Expand All @@ -67,7 +85,7 @@ test {
events "PASSED", "FAILED", "SKIPPED"
}
testLogging.showStandardStreams = true
systemProperty 'spring.profiles.active', 'test'
systemProperty "spring.profiles.active", "test"
}

tasks.withType(JavaCompile).configureEach {
Expand Down
4 changes: 4 additions & 0 deletions server/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rootProject.name=Thesis Track
spring_boot_version=3.3.5
netty_version=4.1.115.Final
testcontainer_version=1.20.3
17 changes: 7 additions & 10 deletions server/src/main/java/thesistrack/ls1/service/CalendarService.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,13 @@ public void deleteEvent(String eventId) {
}

public Optional<VEvent> findVEvent(Calendar calendar, String eventId) {
for (Component component : calendar.getComponents(Component.VEVENT)) {
VEvent event = (VEvent) component;
Optional<Uid> uid = event.getUid();

if (uid.isPresent() && uid.get().getValue().equals(eventId)) {
return Optional.of(event);
}
}

return Optional.empty();
return calendar.getComponents(Component.VEVENT).stream()
.map(component -> (VEvent) component)
.filter(event -> event.getUid()
.map(Uid::getValue)
.filter(value -> value.equals(eventId))
.isPresent())
.findFirst();
}

public VEvent createVEvent(String eventId, CalendarEvent data) {
Expand Down

0 comments on commit 9fc102c

Please sign in to comment.