Skip to content

Commit

Permalink
feat: Cleanup Dependencies to rely on Spring Dependencies Tree - Meed…
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Dec 27, 2023
1 parent fdee0fe commit 6e383ce
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -169,7 +169,7 @@ public void deleteWorkflowById() throws EntityNotFoundException {
List<WorkEntity> 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);
Expand Down Expand Up @@ -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);
Expand All @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 6e383ce

Please sign in to comment.