Skip to content

Commit

Permalink
#285 Upgrade JDK, Gradle, & Fix build warnings (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
conorheffron authored Nov 29, 2024
1 parent c5b3f0a commit 42a6ede
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '23'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
gradle-version: '8.10.2'
gradle-version: '8.11.1'

- name: Build with Gradle 8.10.2
- name: Build with Gradle 8.11.1
run: gradle build

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '23'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
gradle-version: '8.10.2'
gradle-version: '8.11.1'
dependency-graph: download-and-submit
cache-disabled: true

- name: Build with Gradle 8.10.2
- name: Build with Gradle 8.11.1
run: gradle build

dependency-submission:
Expand All @@ -46,9 +46,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '23'
distribution: 'temurin'
gradle-version: 8.10.2
gradle-version: 8.11.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:8.10.2-jdk21-alpine
FROM gradle:8.11.1-jdk23-alpine

COPY . /home/gradle
RUN export LD_BIND_NOW=1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This project also includes form validation of controller model objects and reque
Users can view, add, delete person objects from the database via web UI.

## Technologies Used
Java 21 (LTS Version), Spring Boot 3, Hibernate, MySQL or H2 databases supported, JSP, Gradle 8.10,
Java 23 (LTS Version), Spring Boot 3, Hibernate, MySQL or H2 databases supported, JSP, Gradle 8.10,
GKE, Docker, minikube, & kubectl.

## Run
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ group = 'conorheffron'
version = '5.4.1'
description = "Sample Data Manager"

sourceCompatibility = 21
targetCompatibility = 21
sourceCompatibility = 23
targetCompatibility = 23
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import org.mockito.InjectMocks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
Expand All @@ -37,7 +37,7 @@ public class CustomErrorControllerIntegrationTest {
@Autowired
private ObjectMapper mapper;

@MockBean
@MockitoBean
private PersonDao personDaoMock;

@InjectMocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import org.mockito.InjectMocks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
Expand Down Expand Up @@ -51,7 +51,7 @@ public class PersonControllerIntegrationTest {
@Autowired
private ObjectMapper mapper;

@MockBean
@MockitoBean
private PersonDao personDaoMock;

@InjectMocks
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ironoc/db/config/IronocDbConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class IronocDbConfig {
@Bean
@Profile("h2")
public DataSource dataSource() {
DataSourceBuilder dsBuilder = DataSourceBuilder.create();
DataSourceBuilder<?> dsBuilder = DataSourceBuilder.create();
dsBuilder.driverClassName(environment.getRequiredProperty(DataSourceKey.DRIVER_CLASS_NAME.getKey()));
dsBuilder.url(environment.getRequiredProperty(DataSourceKey.DS_URL.getKey()));
dsBuilder.username(environment.getRequiredProperty(DataSourceKey.DS_USERNAME.getKey()));
Expand Down

0 comments on commit 42a6ede

Please sign in to comment.