From beb79d1f63c0ee0d3ddd5078fc37da23f4db4fff Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 8 Apr 2026 23:51:14 +0000
Subject: [PATCH] Upgrade Java 6 to Java 11
- Update Dropwizard BOM from 1.0.5 to 2.1.12 (decoupled from project version)
- Add dropwizard-dependencies BOM import
- Update maven-compiler-plugin to 3.13.0, use 11
- Update maven-surefire-plugin to 3.2.5
- Update maven-shade-plugin to 3.6.0, add module-info.class exclusion
- Fix @NotEmpty import: org.hibernate.validator.constraints -> javax.validation.constraints
- Fix EmployeeDAO.findAll() typing for Hibernate 5.x Query generics
- Migrate test from JUnit 3 (junit.framework) to JUnit 5 (Jupiter)
Co-Authored-By: prem@cognition.ai
---
pom.xml | 19 +++++++----
.../employee/EmployeeConfiguration.java | 2 +-
.../dropwizard/employee/db/EmployeeDAO.java | 3 +-
.../java/com/dropwizard/employee/AppTest.java | 32 ++++---------------
4 files changed, 22 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3688725..5c52c56 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,14 @@
io.dropwizard
dropwizard-bom
- ${project.version}
+ 2.1.12
+ pom
+ import
+
+
+ io.dropwizard
+ dropwizard-dependencies
+ 2.1.12
pom
import
@@ -119,7 +126,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.19.1
+ 3.2.5
org.apache.maven.plugins
@@ -134,7 +141,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.6.0
+ 3.13.0
org.apache.maven.plugins
@@ -149,7 +156,7 @@
org.apache.maven.plugins
maven-shade-plugin
- 2.4.3
+ 3.6.0
org.apache.maven.plugins
@@ -216,6 +223,7 @@
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
+ module-info.class
@@ -239,8 +247,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 1.6
- 1.6
+ 11
diff --git a/src/main/java/com/dropwizard/employee/EmployeeConfiguration.java b/src/main/java/com/dropwizard/employee/EmployeeConfiguration.java
index 9a8e28f..f16b57d 100644
--- a/src/main/java/com/dropwizard/employee/EmployeeConfiguration.java
+++ b/src/main/java/com/dropwizard/employee/EmployeeConfiguration.java
@@ -3,7 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.Configuration;
import io.dropwizard.db.DataSourceFactory;
-import org.hibernate.validator.constraints.NotEmpty;
+import javax.validation.constraints.NotEmpty;
import com.dropwizard.employee.core.Template;
import javax.validation.Valid;
diff --git a/src/main/java/com/dropwizard/employee/db/EmployeeDAO.java b/src/main/java/com/dropwizard/employee/db/EmployeeDAO.java
index 203bdc2..8695ca5 100644
--- a/src/main/java/com/dropwizard/employee/db/EmployeeDAO.java
+++ b/src/main/java/com/dropwizard/employee/db/EmployeeDAO.java
@@ -21,7 +21,8 @@ public Employee create(Employee person) {
return persist(person);
}
+ @SuppressWarnings("unchecked")
public List findAll() {
- return list(namedQuery("com.dropwizard.employee.core.Employee.findAll"));
+ return list((org.hibernate.query.Query) namedQuery("com.dropwizard.employee.core.Employee.findAll"));
}
}
diff --git a/src/test/java/com/dropwizard/employee/AppTest.java b/src/test/java/com/dropwizard/employee/AppTest.java
index ac98328..d6d3aad 100644
--- a/src/test/java/com/dropwizard/employee/AppTest.java
+++ b/src/test/java/com/dropwizard/employee/AppTest.java
@@ -1,38 +1,18 @@
package com.dropwizard.employee;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Unit test for simple App.
*/
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
+public class AppTest {
/**
* Rigourous Test :-)
*/
- public void testApp()
- {
- assertTrue( true );
+ @Test
+ public void testApp() {
+ assertTrue(true);
}
}