Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Build jar and test
uses: OHSU-OCTRI/shared-workflows/.github/workflows/java-build.yaml@main
with:
java_version: '17'
java_version: '21'
publish_to_github_packages: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/spring-boot-4' || github.ref_type == 'tag' }}
publish_to_maven_central: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/spring-boot-4' || github.ref_type == 'tag' }}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
with:
version: ${{ inputs.version }}
development_version: ${{ inputs.development_version }}
java_version: '17'
java_version: '21'
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
name: Build jar and test
uses: OHSU-OCTRI/shared-workflows/.github/workflows/java-test-build.yaml@main
with:
java_version: '17'
java_version: '21'
# Does not inherit secrets due to security changes in automated workflows
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add Spring Boot 4 branch to branches that publish artifacts (CIS-3896)

### Dependencies

- Upgrade to Spring Boot 4 and Java 21 (CIS-3896)

## [2.1.3] - 2026-08-21

### Changed
Expand Down
18 changes: 14 additions & 4 deletions pom.xml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the updated artifact IDs here (spring-boot-starter-webmvc and webjars-locator-lite) something you had to do manually, or was that handled by OpenRewrite?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was handled by OpenRewrite. Spring Boot's packages were made more granular, and the OpenRewrite recipe knows what transformations to make.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.16</version>
<version>4.0.8</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
Expand All @@ -38,7 +38,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<opencsv.version>5.11.1</opencsv.version>
<poi.version>5.5.1</poi.version>
</properties>
Expand Down Expand Up @@ -69,7 +69,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -84,6 +84,16 @@
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>${opencsv.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
Expand All @@ -97,7 +107,7 @@
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
<artifactId>webjars-locator-lite</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/octri/common/config/ViewConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ private Mustache.Formatter mustacheFormatter() {
return new Mustache.Formatter() {

public String format(Object value) {
if (value instanceof LocalDate) {
return dateFormatter.print((LocalDate) value);
} else if (value instanceof LocalDateTime) {
return dateTimeFormatter.print((LocalDateTime) value);
if (value instanceof LocalDate date) {
return dateFormatter.print(date);
} else if (value instanceof LocalDateTime time) {
return dateTimeFormatter.print(time);
Comment on lines +78 to +81

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new syntax as of Java 16 that allows using the value checked by instanceof without a cast.

} else {
return String.valueOf(value);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/octri/common/domain/AbstractEntity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.octri.common.domain;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.ZoneId;
Expand Down Expand Up @@ -28,6 +29,7 @@
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractEntity implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/octri/common/view/ViteManifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import tools.jackson.databind.json.JsonMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.ObjectMapper;

public class ViteManifest {

private static final Logger log = LoggerFactory.getLogger(ViteManifest.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
private static final ObjectMapper objectMapper = new JsonMapper();

private final Map<String, ViteManifestChunk> chunkMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package org.octri.common.validation;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.time.LocalDate;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class CurrentOrFutureDateValidatorTest {

private CurrentOrFutureDateValidator validator = new CurrentOrFutureDateValidator();

@Test
public void testCurrentDateIsValid() {
assertTrue("Current LocalDate should be valid", validator.isValid(LocalDate.now(), null));
assertTrue(validator.isValid(LocalDate.now(), null), "Current LocalDate should be valid");
}

@Test
public void testFutureDateIsValid() {
assertTrue("Future LocalDate should be valid", validator.isValid(LocalDate.now().plusDays(1), null));
assertTrue(validator.isValid(LocalDate.now().plusDays(1), null), "Future LocalDate should be valid");
}

@Test
public void testNullIsValid() {
assertTrue("Null LocalDate should be valid", validator.isValid(null, null));
assertTrue(validator.isValid(null, null), "Null LocalDate should be valid");
}

@Test
public void testPastDateIsNotValid() {
assertFalse("Past date should not be valid", validator.isValid(LocalDate.now().minusDays(1), null));
assertFalse(validator.isValid(LocalDate.now().minusDays(1), null), "Past date should not be valid");
}

}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package org.octri.common.validation;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.time.LocalDate;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class CurrentOrPastDateValidatorTest {

private CurrentOrPastDateValidator validator = new CurrentOrPastDateValidator();

@Test
public void testCurrentDateIsValid() {
assertTrue("Current LocalDate should be valid", validator.isValid(LocalDate.now(), null));
assertTrue(validator.isValid(LocalDate.now(), null), "Current LocalDate should be valid");
}

@Test
public void testPastDateIsValid() {
assertTrue("Future LocalDate should be valid", validator.isValid(LocalDate.now().minusDays(1), null));
assertTrue(validator.isValid(LocalDate.now().minusDays(1), null), "Future LocalDate should be valid");
}

@Test
public void testNullIsValid() {
assertTrue("Null LocalDate should be valid", validator.isValid(null, null));
assertTrue(validator.isValid(null, null), "Null LocalDate should be valid");
}

@Test
public void testFutureDateIsNotValid() {
assertFalse("Past date should not be valid", validator.isValid(LocalDate.now().plusDays(1), null));
assertFalse(validator.isValid(LocalDate.now().plusDays(1), null), "Past date should not be valid");
}

}
Loading