Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PO--1148: Remove some deprecated warnings from the Java build process. #723

Merged
merged 1 commit into from
Feb 5, 2025
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
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ configurations {
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
options.compilerArgs << "-Xlint:unchecked"
// Enable the following to highlight all deprecated build errors
options.compilerArgs << "-Xlint:deprecation"
// Enable the following to stop the build on any warning messages (not just error messages)
options.compilerArgs << "-Werror"
}

// https://github.com/gradle/gradle/issues/16791
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.hibernate.LazyInitializationException;
import org.hibernate.PropertyValueException;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -16,6 +17,7 @@
import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -307,7 +309,8 @@ void testHandleHttpMediaTypeNotSupportedException() {

@Test
void testHandleHttpMessageNotReadableException() {
HttpMessageNotReadableException exception = new HttpMessageNotReadableException("Cannot read message");
HttpInputMessage msg = Mockito.mock(HttpInputMessage.class);
HttpMessageNotReadableException exception = new HttpMessageNotReadableException("Cannot read message", msg);
ResponseEntity<Map<String, String>> response = globalExceptionHandler
.handleHttpMessageNotReadableException(exception);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FileHandlerJobTest {

@BeforeEach
void setUp() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LogRetentionJobTest {

@BeforeEach
void setUp() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class JobServiceTest {

@BeforeEach
void setUp() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LogRetentionServiceTest {

@BeforeEach
void setUp() {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
logRetentionService = new LogRetentionService(jdbcTemplate);
}

Expand All @@ -39,4 +39,3 @@ void testDeleteExpiredLogAudit_DatabaseError() {
verify(jdbcTemplate).execute("CALL delete_expired_log_audit()");
}
}