diff --git a/processes-api/src/main/java/org/exoplatform/processes/storage/ProcessesStorage.java b/processes-api/src/main/java/org/exoplatform/processes/storage/ProcessesStorage.java index 73984f7f5..1e006dcc7 100644 --- a/processes-api/src/main/java/org/exoplatform/processes/storage/ProcessesStorage.java +++ b/processes-api/src/main/java/org/exoplatform/processes/storage/ProcessesStorage.java @@ -24,7 +24,7 @@ import org.exoplatform.processes.model.*; import org.exoplatform.social.core.identity.model.Identity; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.EntityNotFoundException; public interface ProcessesStorage { diff --git a/processes-services/src/main/java/org/exoplatform/processes/Utils/EntityMapper.java b/processes-services/src/main/java/org/exoplatform/processes/Utils/EntityMapper.java index 98e888e51..ad127a8a6 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/Utils/EntityMapper.java +++ b/processes-services/src/main/java/org/exoplatform/processes/Utils/EntityMapper.java @@ -7,7 +7,7 @@ import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.utils.CommonsUtils; import org.exoplatform.processes.entity.WorkEntity; diff --git a/processes-services/src/main/java/org/exoplatform/processes/dao/WorkDraftDAO.java b/processes-services/src/main/java/org/exoplatform/processes/dao/WorkDraftDAO.java index da5088239..b49edaf61 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/dao/WorkDraftDAO.java +++ b/processes-services/src/main/java/org/exoplatform/processes/dao/WorkDraftDAO.java @@ -21,9 +21,9 @@ import org.exoplatform.processes.entity.WorkFlowEntity; import org.exoplatform.processes.model.WorkFilter; -import javax.persistence.Query; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.*; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/processes-services/src/main/java/org/exoplatform/processes/dao/WorkFlowDAO.java b/processes-services/src/main/java/org/exoplatform/processes/dao/WorkFlowDAO.java index 1998d5d68..9862d0cab 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/dao/WorkFlowDAO.java +++ b/processes-services/src/main/java/org/exoplatform/processes/dao/WorkFlowDAO.java @@ -5,12 +5,12 @@ import java.util.List; import java.util.stream.Collectors; -import javax.persistence.NoResultException; -import javax.persistence.Query; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.*; +import jakarta.persistence.NoResultException; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.*; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl; import org.exoplatform.processes.entity.WorkFlowEntity; import org.exoplatform.processes.model.ProcessesFilter; diff --git a/processes-services/src/main/java/org/exoplatform/processes/entity/WorkEntity.java b/processes-services/src/main/java/org/exoplatform/processes/entity/WorkEntity.java index 0adcb0629..a3757681f 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/entity/WorkEntity.java +++ b/processes-services/src/main/java/org/exoplatform/processes/entity/WorkEntity.java @@ -19,7 +19,7 @@ import lombok.Data; import org.exoplatform.commons.api.persistence.ExoEntity; -import javax.persistence.*; +import jakarta.persistence.*; import java.io.Serializable; import java.util.Date; diff --git a/processes-services/src/main/java/org/exoplatform/processes/entity/WorkFlowEntity.java b/processes-services/src/main/java/org/exoplatform/processes/entity/WorkFlowEntity.java index 7df12f14b..1376beeda 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/entity/WorkFlowEntity.java +++ b/processes-services/src/main/java/org/exoplatform/processes/entity/WorkFlowEntity.java @@ -5,7 +5,7 @@ import java.util.HashSet; import java.util.Set; -import javax.persistence.*; +import jakarta.persistence.*; import org.exoplatform.commons.api.persistence.ExoEntity; diff --git a/processes-services/src/main/java/org/exoplatform/processes/rest/ProcessesRest.java b/processes-services/src/main/java/org/exoplatform/processes/rest/ProcessesRest.java index 86ed175aa..341878441 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/rest/ProcessesRest.java +++ b/processes-services/src/main/java/org/exoplatform/processes/rest/ProcessesRest.java @@ -23,7 +23,7 @@ import javax.annotation.security.RolesAllowed; import javax.jcr.ItemExistsException; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.EntityNotFoundException; import javax.ws.rs.*; import javax.ws.rs.core.*; @@ -35,7 +35,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.exception.ObjectNotFoundException; import org.exoplatform.processes.model.*; import org.exoplatform.processes.rest.model.WorkEntity; diff --git a/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java b/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java index bc623aa3b..f0ebfd82b 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java +++ b/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java @@ -7,7 +7,7 @@ import java.util.*; import java.util.stream.Collectors; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.exception.ObjectNotFoundException; import org.exoplatform.commons.file.model.FileInfo; @@ -313,7 +313,7 @@ public Work getWorkById(long userIdentityId, long workId) { taskDto = list.get(0); } } catch (EntityNotFoundException e) { - throw new javax.persistence.EntityNotFoundException("work not found"); + throw new jakarta.persistence.EntityNotFoundException("work not found"); } catch (Exception e) { LOG.error("Error while getting work"); } @@ -442,10 +442,10 @@ private WorkFlow createProject(WorkFlow workFlow) { * {@inheritDoc} */ @Override - public void deleteWorkflowById(Long workflowId) throws javax.persistence.EntityNotFoundException { + public void deleteWorkflowById(Long workflowId) throws jakarta.persistence.EntityNotFoundException { WorkFlowEntity workFlowEntity = this.workFlowDAO.find(workflowId); if (workFlowEntity == null) { - throw new javax.persistence.EntityNotFoundException("Workflow not found"); + throw new jakarta.persistence.EntityNotFoundException("Workflow not found"); } try { ProjectDto project = projectService.getProject(workFlowEntity.getProjectId()); @@ -492,7 +492,7 @@ public Work updateWorkCompleted(Long workId, boolean completed) { taskDto = taskService.updateTask(taskDto); } } catch (EntityNotFoundException e) { - throw new javax.persistence.EntityNotFoundException("work not found"); + throw new jakarta.persistence.EntityNotFoundException("work not found"); } return EntityMapper.taskToWork(taskDto); } @@ -546,10 +546,10 @@ public Work getWorkDraftyId(long id) { * {@inheritDoc} */ @Override - public void deleteWorkDraftById(long id) throws javax.persistence.EntityNotFoundException { + public void deleteWorkDraftById(long id) throws jakarta.persistence.EntityNotFoundException { WorkEntity workEntity = workDraftDAO.find(id); if (workEntity == null) { - throw new javax.persistence.EntityNotFoundException("Work Draft not found"); + throw new jakarta.persistence.EntityNotFoundException("Work Draft not found"); } workDraftDAO.delete(workEntity); } diff --git a/processes-services/src/test/java/org/exoplatform/processes/rest/ProcessesRestTest.java b/processes-services/src/test/java/org/exoplatform/processes/rest/ProcessesRestTest.java index 2f06985d7..615a891e4 100644 --- a/processes-services/src/test/java/org/exoplatform/processes/rest/ProcessesRestTest.java +++ b/processes-services/src/test/java/org/exoplatform/processes/rest/ProcessesRestTest.java @@ -19,7 +19,7 @@ import java.util.Map; import javax.jcr.ItemExistsException; -import javax.persistence.EntityNotFoundException; +import jakarta.persistence.EntityNotFoundException; import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.Request; import javax.ws.rs.core.Response; diff --git a/processes-services/src/test/java/org/exoplatform/processes/storage/ProcessesStorageImplTest.java b/processes-services/src/test/java/org/exoplatform/processes/storage/ProcessesStorageImplTest.java index 50a2b00ee..8af747641 100644 --- a/processes-services/src/test/java/org/exoplatform/processes/storage/ProcessesStorageImplTest.java +++ b/processes-services/src/test/java/org/exoplatform/processes/storage/ProcessesStorageImplTest.java @@ -25,7 +25,7 @@ import javax.ws.rs.ext.RuntimeDelegate; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; @@ -169,7 +169,7 @@ public void deleteWorkflowById() throws EntityNotFoundException { List drafts = new ArrayList<>(); drafts.add(new WorkEntity()); when(workFlowDAO.find(1l)).thenReturn(null); - Throwable exception = assertThrows(javax.persistence.EntityNotFoundException.class, + Throwable exception = assertThrows(jakarta.persistence.EntityNotFoundException.class, () -> this.processesStorage.deleteWorkflowById(1l)); assertEquals("Workflow not found", exception.getMessage()); verify(projectService, times(0)).getProject(0l); @@ -404,7 +404,7 @@ public void saveWorkDraft() { public void deleteWorkDraftById() { org.exoplatform.processes.entity.WorkEntity WorkEntity = new org.exoplatform.processes.entity.WorkEntity(); when(workDraftDAO.find(1L)).thenReturn(null); - Throwable exception1 = assertThrows(javax.persistence.EntityNotFoundException.class, + Throwable exception1 = assertThrows(jakarta.persistence.EntityNotFoundException.class, () -> this.processesStorage.deleteWorkDraftById(1l)); assertEquals("Work Draft not found", exception1.getMessage()); when(workDraftDAO.find(1L)).thenReturn(WorkEntity); @@ -427,7 +427,7 @@ public void getWorkById() throws Exception { processesStorage.getWorkById(1L, 1L); EntityMapper.taskToWork(taskDto); when(taskService.findTasks(any(), anyInt(), anyInt())).thenThrow(new EntityNotFoundException(1L, Object.class)); - Throwable exception2 = assertThrows(javax.persistence.EntityNotFoundException.class, + Throwable exception2 = assertThrows(jakarta.persistence.EntityNotFoundException.class, () -> this.processesStorage.getWorkById(1L, 1L)); assertEquals("work not found", exception2.getMessage()); } @@ -487,7 +487,7 @@ public void updateWorkCompleted() throws EntityNotFoundException { processesStorage.updateWorkCompleted(1L, true); verify(taskService, times(1)).updateTask(taskDto); when(taskService.getTask(1L)).thenThrow(new EntityNotFoundException(1L, Object.class)); - Throwable exception2 = assertThrows(javax.persistence.EntityNotFoundException.class, + Throwable exception2 = assertThrows(jakarta.persistence.EntityNotFoundException.class, () -> this.processesStorage.updateWorkCompleted(1L, true)); assertEquals("work not found", exception2.getMessage()); }