syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1506985 - in /syncope/trunk: common/src/main/java/org/apache/syncope/common/services/ console/src/main/java/org/apache/syncope/console/rest/ core/src/main/java/org/apache/syncope/core/rest/controller/ core/src/main/java/org/apache/syncope/...
Date Thu, 25 Jul 2013 14:26:39 GMT
Author: ilgrosso
Date: Thu Jul 25 14:26:38 2013
New Revision: 1506985

URL: http://svn.apache.org/r1506985
Log:
[SYNCOPE-285] Alignign TaskService and PolicyService in terms of 'type' path parameters

Modified:
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
    syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/PolicyDataBinder.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java Thu Jul 25 14:26:38 2013
@@ -31,76 +31,67 @@ import org.apache.syncope.common.to.Corr
 import org.apache.syncope.common.to.AbstractPolicyTO;
 import org.apache.syncope.common.types.PolicyType;
 
-@Path("policies/{type}")
+@Path("policies")
 public interface PolicyService {
 
     /**
-     * @param type Creates a new policy with given type
      * @param policyTO Policy to be created (needs to match type)
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
      * @return Response containing URI location for created resource
      */
     @POST
-    <T extends AbstractPolicyTO> Response create(@PathParam("type") PolicyType type, T policyTO);
+    <T extends AbstractPolicyTO> Response create(T policyTO);
 
     /**
-     * @param type Deletes policy with given type
      * @param policyId Deletes policy with given id
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
      */
     @DELETE
     @Path("{policyId}")
-    <T extends AbstractPolicyTO> void delete(@PathParam("type") PolicyType type, @PathParam("policyId") Long policyId);
+    <T extends AbstractPolicyTO> void delete(@PathParam("policyId") Long policyId);
 
     /**
      * @param type Type selector for requested policies
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
-     * @return List of policies with matching type.
+     * @return List of policies with matching type
      */
     @GET
+    @Path("{type}/list")
+    // TODO '/list' path will be removed once CXF/JAX-B bug is solved
     <T extends AbstractPolicyTO> List<T> list(@PathParam("type") PolicyType type);
 
     /**
-     * @param type Request for policy with given type
      * @param policyId ID of requested policy
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
-     * @return Returns policy with matching id and type
+     * @return policy with matching id
      */
     @GET
     @Path("{policyId}")
-    <T extends AbstractPolicyTO> T read(@PathParam("type") PolicyType type, @PathParam("policyId") Long policyId);
+    <T extends AbstractPolicyTO> T read(@PathParam("policyId") Long policyId);
 
     /**
      * @param type PolicyType to read global policy from
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
      * @return Global Policy for matching type
      */
     @GET
-    @Path("0")
+    @Path("{type}/0")
     <T extends AbstractPolicyTO> T readGlobal(@PathParam("type") PolicyType type);
 
     /**
-     * @param type PolicyType to be updated.
      * @param policyId ID of policy to be updated
      * @param policyTO Policy to replace existing policy
      * @param <T> response type (extending PolicyTO)
-     * @see PolicyTO
      */
     @PUT
     @Path("{policyId}")
-    <T extends AbstractPolicyTO> void update(@PathParam("type") PolicyType type, @PathParam("policyId") Long policyId,
-            T policyTO);
+    <T extends AbstractPolicyTO> void update(@PathParam("policyId") Long policyId, T policyTO);
 
     /**
      * @param type PolicyType (just SYNC is supported).
-     * @return Returns correlation rules java classes.
+     * @return correlation rules java classes
      */
     @GET
     @Path("syncCorrelationRuleClasses")
-    Set<CorrelationRuleClassTO> getSyncCorrelationRuleClasses(@PathParam("type") PolicyType type);
+    Set<CorrelationRuleClassTO> getSyncCorrelationRuleClasses();
 }

Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java Thu Jul 25 14:26:38 2013
@@ -38,6 +38,7 @@ import org.apache.syncope.common.to.Repo
 import org.apache.syncope.common.to.SyncActionClassTO;
 import org.apache.syncope.common.to.TaskExecTO;
 import org.apache.syncope.common.to.AbstractTaskTO;
+import org.apache.syncope.common.to.SchedTaskTO;
 import org.apache.syncope.common.types.TaskType;
 
 @Path("tasks")
@@ -53,10 +54,11 @@ public interface TaskService {
 
     /**
      * @param taskTO Task to be created
+     * @param <T> type of taskTO
      * @return Response containing URI location for created resource
      */
     @POST
-    Response create(AbstractTaskTO taskTO);
+    <T extends SchedTaskTO> Response create(T taskTO);
 
     /**
      * @param taskId Id of task to be deleted
@@ -97,6 +99,7 @@ public interface TaskService {
 
     /**
      * @param taskType Type of tasks to be listed
+     * @param <T> type of taskTO
      * @return Returns list of tasks with matching type
      */
     @GET
@@ -108,22 +111,22 @@ public interface TaskService {
      * @param taskType Type of tasks to be listed
      * @param page Page number of tasks in relation to page size
      * @param size Number of tasks listed per page
+     * @param <T> type of taskTO
      * @return Returns paginated list of task with matching type
      */
     @GET
     @Path("{type}")
-    <T extends AbstractTaskTO> List<T> list(@PathParam("type") TaskType taskType, @QueryParam("page") int page,
-            @QueryParam("size") @DefaultValue("25") int size);
+    <T extends AbstractTaskTO> List<T> list(@PathParam("type") TaskType taskType,
+            @QueryParam("page") int page, @QueryParam("size") @DefaultValue("25") int size);
 
     /**
-     * @param taskType Type of task to be read
      * @param taskId Id of task to be read
+     * @param <T> type of taskTO
      * @return Returns task with matching id
      */
     @GET
-    @Path("{type}/{taskId}")
-    // TODO TaskType can be removed once CXF migration is done
-    <T extends AbstractTaskTO> T read(@PathParam("type") TaskType taskType, @PathParam("taskId") Long taskId);
+    @Path("{taskId}")
+    <T extends AbstractTaskTO> T read(@PathParam("taskId") Long taskId);
 
     /**
      * @param executionId Id if task execution to be read
@@ -148,7 +151,7 @@ public interface TaskService {
     @PUT
     @Path("{taskId}")
     void update(@PathParam("taskId") Long taskId, AbstractTaskTO taskTO);
-    
+
     @POST
     @Path("bulk")
     BulkActionRes bulkAction(BulkAction bulkAction);

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java Thu Jul 25 14:26:38 2013
@@ -21,10 +21,7 @@ package org.apache.syncope.console.rest;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.syncope.common.services.PolicyService;
-import org.apache.syncope.common.to.AccountPolicyTO;
-import org.apache.syncope.common.to.PasswordPolicyTO;
 import org.apache.syncope.common.to.AbstractPolicyTO;
-import org.apache.syncope.common.to.SyncPolicyTO;
 import org.apache.syncope.common.types.PolicyType;
 import org.apache.syncope.common.util.CollectionWrapper;
 import org.springframework.stereotype.Component;
@@ -72,15 +69,15 @@ public class PolicyRestClient extends Ba
     }
 
     public <T extends AbstractPolicyTO> void createPolicy(final T policy) {
-        getService(PolicyService.class).create(policy.getType(), policy);
+        getService(PolicyService.class).create(policy);
     }
 
     public <T extends AbstractPolicyTO> void updatePolicy(final T policy) {
-        getService(PolicyService.class).update(policy.getType(), policy.getId(), policy);
+        getService(PolicyService.class).update(policy.getId(), policy);
     }
 
     public void delete(final Long id, final Class<? extends AbstractPolicyTO> policyClass) {
-        getService(PolicyService.class).delete(getPolicyType(policyClass), id);
+        getService(PolicyService.class).delete(id);
     }
 
     public List<String> getCorrelationRuleClasses() {
@@ -88,25 +85,11 @@ public class PolicyRestClient extends Ba
 
         try {
             rules = CollectionWrapper.unwrapSyncCorrelationRuleClasses(
-                    getService(PolicyService.class).getSyncCorrelationRuleClasses(PolicyType.SYNC));
+                    getService(PolicyService.class).getSyncCorrelationRuleClasses());
         } catch (Exception e) {
             LOG.error("While getting all correlation rule classes", e);
         }
 
         return rules;
     }
-
-    private PolicyType getPolicyType(final Class<? extends AbstractPolicyTO> clazz) {
-        PolicyType policyType;
-        if (AccountPolicyTO.class.equals(clazz)) {
-            policyType = PolicyType.ACCOUNT;
-        } else if (PasswordPolicyTO.class.equals(clazz)) {
-            policyType = PolicyType.PASSWORD;
-        } else if (SyncPolicyTO.class.equals(clazz)) {
-            policyType = PolicyType.SYNC;
-        } else {
-            throw new IllegalArgumentException("Policy Type not supported");
-        }
-        return policyType;
-    }
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java Thu Jul 25 14:26:38 2013
@@ -106,15 +106,15 @@ public class TaskRestClient extends Base
     }
 
     public PropagationTaskTO readPropagationTask(final Long taskId) {
-        return getService(TaskService.class).read(TaskType.PROPAGATION, taskId);
+        return getService(TaskService.class).read(taskId);
     }
 
     public NotificationTaskTO readNotificationTask(final Long taskId) {
-        return getService(TaskService.class).read(TaskType.NOTIFICATION, taskId);
+        return getService(TaskService.class).read(taskId);
     }
 
     public <T extends SchedTaskTO> T readSchedTask(final Class<T> reference, final Long taskId) {
-        return getService(TaskService.class).read(getTaskType(reference), taskId);
+        return getService(TaskService.class).read(taskId);
     }
 
     /**

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java Thu Jul 25 14:26:38 2013
@@ -191,13 +191,13 @@ public class PolicyController extends Ab
     }
 
     @PreAuthorize("hasRole('POLICY_DELETE')")
-    public AbstractPolicyTO delete(final Long id) {
+    public <T extends AbstractPolicyTO> T delete(final Long id) {
         Policy policy = policyDAO.find(id);
         if (policy == null) {
             throw new NotFoundException("Policy " + id + " not found");
         }
 
-        AbstractPolicyTO policyToDelete = binder.getPolicyTO(policy);
+        T policyToDelete = binder.getPolicyTO(policy);
         policyDAO.delete(policy);
 
         auditManager.audit(Category.policy, PolicySubCategory.delete, Result.success,

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java Thu Jul 25 14:26:38 2013
@@ -93,7 +93,7 @@ public class TaskController extends Abst
     private ImplementationClassNamesLoader classNamesLoader;
 
     @PreAuthorize("hasRole('TASK_CREATE')")
-    public AbstractTaskTO createSchedTask(final SchedTaskTO taskTO) {
+    public <T extends SchedTaskTO> T createSchedTask(final T taskTO) {
         LOG.debug("Creating task " + taskTO);
 
         TaskUtil taskUtil = TaskUtil.getInstance(taskTO);
@@ -121,12 +121,12 @@ public class TaskController extends Abst
     }
 
     @PreAuthorize("hasRole('TASK_UPDATE')")
-    public AbstractTaskTO updateSync(final SyncTaskTO taskTO) {
+    public SyncTaskTO updateSync(final SyncTaskTO taskTO) {
         return updateSched(taskTO);
     }
 
     @PreAuthorize("hasRole('TASK_UPDATE')")
-    public AbstractTaskTO updateSched(final SchedTaskTO taskTO) {
+    public <T extends SchedTaskTO> T updateSched(final SchedTaskTO taskTO) {
         LOG.debug("Task update called with parameter {}", taskTO);
 
         SchedTask task = taskDAO.find(taskTO.getId());
@@ -219,7 +219,7 @@ public class TaskController extends Abst
     }
 
     @PreAuthorize("hasRole('TASK_READ')")
-    public AbstractTaskTO read(final Long taskId) {
+    public <T extends AbstractTaskTO> T read(final Long taskId) {
         Task task = taskDAO.find(taskId);
         if (task == null) {
             throw new NotFoundException("Task " + taskId);
@@ -365,14 +365,14 @@ public class TaskController extends Abst
     }
 
     @PreAuthorize("hasRole('TASK_DELETE')")
-    public AbstractTaskTO delete(final Long taskId) {
+    public <T extends AbstractTaskTO> T delete(final Long taskId) {
         Task task = taskDAO.find(taskId);
         if (task == null) {
             throw new NotFoundException("Task " + taskId);
         }
         TaskUtil taskUtil = TaskUtil.getInstance(task);
 
-        AbstractTaskTO taskToDelete = binder.getTaskTO(task, taskUtil);
+        T taskToDelete = binder.getTaskTO(task, taskUtil);
 
         if (TaskType.SCHEDULED == taskUtil.getType() || TaskType.SYNCHRONIZATION == taskUtil.getType()) {
             jobInstanceLoader.unregisterJob(task);

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/PolicyDataBinder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/PolicyDataBinder.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/PolicyDataBinder.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/PolicyDataBinder.java Thu Jul 25 14:26:38 2013
@@ -62,7 +62,7 @@ public class PolicyDataBinder {
      */
     @SuppressWarnings("unchecked")
     public <T extends AbstractPolicyTO> T getPolicyTO(final Policy policy) {
-        final AbstractPolicyTO policyTO;
+        final T policyTO;
 
         final boolean isGlobal = isGlobalPolicy(policy.getType());
 
@@ -73,7 +73,7 @@ public class PolicyDataBinder {
                     throw new ClassCastException("Expected " + PasswordPolicySpec.class.getName()
                             + ", found " + policy.getSpecification().getClass().getName());
                 }
-                policyTO = new PasswordPolicyTO(isGlobal);
+                policyTO = (T) new PasswordPolicyTO(isGlobal);
                 ((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) policy.getSpecification());
                 break;
 
@@ -83,7 +83,7 @@ public class PolicyDataBinder {
                     throw new ClassCastException("Expected " + AccountPolicySpec.class.getName()
                             + ", found " + policy.getSpecification().getClass().getName());
                 }
-                policyTO = new AccountPolicyTO(isGlobal);
+                policyTO = (T) new AccountPolicyTO(isGlobal);
                 ((AccountPolicyTO) policyTO).setSpecification((AccountPolicySpec) policy.getSpecification());
                 break;
 
@@ -95,14 +95,14 @@ public class PolicyDataBinder {
                             + ", found " + policy.getSpecification().getClass().getName());
 
                 }
-                policyTO = new SyncPolicyTO(isGlobal);
+                policyTO = (T) new SyncPolicyTO(isGlobal);
                 ((SyncPolicyTO) policyTO).setSpecification((SyncPolicySpec) policy.getSpecification());
         }
 
         policyTO.setId(policy.getId());
         policyTO.setDescription(policy.getDescription());
 
-        return (T) policyTO;
+        return policyTO;
     }
 
     @SuppressWarnings("unchecked")

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/TaskDataBinder.java Thu Jul 25 14:26:38 2013
@@ -226,8 +226,8 @@ public class TaskDataBinder {
         }
     }
 
-    public AbstractTaskTO getTaskTO(final Task task, final TaskUtil taskUtil) {
-        AbstractTaskTO taskTO = taskUtil.newTaskTO();
+    public <T extends AbstractTaskTO> T getTaskTO(final Task task, final TaskUtil taskUtil) {
+        T taskTO = taskUtil.newTaskTO();
         BeanUtils.copyProperties(task, taskTO, IGNORE_TASK_PROPERTIES);
 
         TaskExec latestExec = taskExecDAO.findLatestStarted(task);

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -44,7 +44,7 @@ public class ConnectorServiceImpl extend
     @Override
     public Response create(final ConnInstanceTO connInstanceTO) {
         ConnInstanceTO connInstance = controller.create(connInstanceTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path(connInstance.getId() + "").build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(connInstance.getId())).build();
         return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, connInstance.getId()).build();
     }
 

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -39,7 +39,7 @@ public class NotificationServiceImpl ext
     @Override
     public Response create(final NotificationTO notificationTO) {
         NotificationTO createdNotificationTO = controller.create(notificationTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path("" + createdNotificationTO.getId()).build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(createdNotificationTO.getId())).build();
         return Response.created(location)
                 .header(SyncopeConstants.REST_HEADER_ID, createdNotificationTO.getId())
                 .build();

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -43,14 +43,14 @@ public class PolicyServiceImpl extends A
     private PolicyController policyController;
 
     @Override
-    public <T extends AbstractPolicyTO> Response create(final PolicyType type, final T policyTO) {
+    public <T extends AbstractPolicyTO> Response create(final T policyTO) {
         AbstractPolicyTO policy = policyController.create(policyTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path(policy.getId() + "").build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(policy.getId())).build();
         return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, policy.getId()).build();
     }
 
     @Override
-    public void delete(final PolicyType type, final Long policyId) {
+    public void delete(final Long policyId) {
         policyController.delete(policyId);
     }
 
@@ -60,7 +60,7 @@ public class PolicyServiceImpl extends A
     }
 
     @Override
-    public <T extends AbstractPolicyTO> T read(final PolicyType type, final Long policyId) {
+    public <T extends AbstractPolicyTO> T read(final Long policyId) {
         return policyController.read(policyId);
     }
 
@@ -93,8 +93,8 @@ public class PolicyServiceImpl extends A
     }
 
     @Override
-    public <T extends AbstractPolicyTO> void update(final PolicyType type, final Long policyId, final T policyTO) {
-        switch (type) {
+    public <T extends AbstractPolicyTO> void update(final Long policyId, final T policyTO) {
+        switch (policyTO.getType()) {
             case ACCOUNT:
             case GLOBAL_ACCOUNT:
                 policyController.update((AccountPolicyTO) policyTO);
@@ -116,21 +116,7 @@ public class PolicyServiceImpl extends A
     }
 
     @Override
-    public Set<CorrelationRuleClassTO> getSyncCorrelationRuleClasses(final PolicyType type) {
-        Set<CorrelationRuleClassTO> result = null;
-
-        switch (type) {
-            case SYNC:
-            case GLOBAL_SYNC:
-
-                result = CollectionWrapper.wrapSyncCorrelationRuleClasses(
-                        policyController.getSyncCorrelationRuleClasses());
-                break;
-
-            default:
-                throw new BadRequestException();
-        }
-
-        return result;
+    public Set<CorrelationRuleClassTO> getSyncCorrelationRuleClasses() {
+        return CollectionWrapper.wrapSyncCorrelationRuleClasses(policyController.getSyncCorrelationRuleClasses());
     }
 }

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -48,7 +48,7 @@ public class ReportServiceImpl extends A
     @Override
     public Response create(final ReportTO reportTO) {
         ReportTO createdReportTO = controller.create(reportTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path("" + createdReportTO.getId()).build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(createdReportTO.getId())).build();
         return Response.created(location)
                 .header(SyncopeConstants.REST_HEADER_ID, createdReportTO.getId())
                 .build();

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -53,7 +53,7 @@ public class RoleServiceImpl extends Abs
     @Override
     public Response create(final RoleTO roleTO) {
         RoleTO created = controller.create(roleTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path(created.getId() + "").build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(created.getId())).build();
         return Response.created(location)
                 .header(SyncopeConstants.REST_HEADER_ID, created.getId())
                 .entity(created)

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -38,7 +38,6 @@ import org.apache.syncope.common.types.P
 import org.apache.syncope.common.types.TaskType;
 import org.apache.syncope.common.util.CollectionWrapper;
 import org.apache.syncope.core.rest.controller.TaskController;
-import org.apache.syncope.core.util.TaskUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -54,16 +53,15 @@ public class TaskServiceImpl extends Abs
     }
 
     @Override
-    public Response create(final AbstractTaskTO taskTO) {
-        AbstractTaskTO createdTask;
+    public <T extends SchedTaskTO> Response create(final T taskTO) {
+        T createdTask;
         if (taskTO instanceof SyncTaskTO || taskTO instanceof SchedTaskTO) {
-            createdTask = controller.createSchedTask((SchedTaskTO) taskTO);
+            createdTask = controller.createSchedTask(taskTO);
         } else {
             throw new BadRequestException();
         }
 
-        TaskType taskType = TaskUtil.getInstance(taskTO.getClass()).getType();
-        URI location = uriInfo.getAbsolutePathBuilder().path(taskType.toString() + "/" + createdTask.getId()).build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(createdTask.getId())).build();
         return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, createdTask.getId()).build();
     }
 
@@ -102,10 +100,9 @@ public class TaskServiceImpl extends Abs
         return controller.list(taskType, page, size);
     }
 
-    @SuppressWarnings("unchecked")
     @Override
-    public <T extends AbstractTaskTO> T read(final TaskType taskType, final Long taskId) {
-        return (T) controller.read(taskId);
+    public <T extends AbstractTaskTO> T read(final Long taskId) {
+        return controller.read(taskId);
     }
 
     @Override

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -66,7 +66,7 @@ public class UserRequestServiceImpl exte
                 break;
         }
 
-        URI location = uriInfo.getAbsolutePathBuilder().path("" + outUserRequestTO.getId()).build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(outUserRequestTO.getId())).build();
         return Response.created(location)
                 .header(SyncopeConstants.REST_HEADER_ID, outUserRequestTO.getId())
                 .build();

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java Thu Jul 25 14:26:38 2013
@@ -69,7 +69,7 @@ public class UserServiceImpl extends Abs
     @Override
     public Response create(final UserTO userTO) {
         UserTO created = controller.create(userTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path(created.getId() + "").build();
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(created.getId())).build();
         return Response.created(location).
                 header(SyncopeConstants.REST_HEADER_ID, created.getId()).
                 entity(created)

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java Thu Jul 25 14:26:38 2013
@@ -55,7 +55,6 @@ import org.apache.syncope.common.to.Reso
 import org.apache.syncope.common.to.RoleTO;
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.AttributableType;
-import org.apache.syncope.common.types.PolicyType;
 import org.apache.syncope.common.types.SchemaType;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -233,8 +232,8 @@ public abstract class AbstractTest {
     }
 
     @SuppressWarnings("unchecked")
-    protected <T extends AbstractPolicyTO> T createPolicy(final PolicyType policyType, final T policy) {
-        Response response = policyService.create(policyType, policy);
+    protected <T extends AbstractPolicyTO> T createPolicy(final T policy) {
+        Response response = policyService.create(policy);
         if (response.getStatus() != org.apache.http.HttpStatus.SC_CREATED) {
             Exception ex = clientExceptionMapper.fromResponse(response);
             if (ex != null) {

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java Thu Jul 25 14:26:38 2013
@@ -50,7 +50,7 @@ public class PolicyTestITCase extends Ab
 
     @Test
     public void read() {
-        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 1L);
+        SyncPolicyTO policyTO = policyService.read(1L);
 
         assertNotNull(policyTO);
     }
@@ -79,7 +79,7 @@ public class PolicyTestITCase extends Ab
         policy.setDescription("global password policy");
 
         try {
-            createPolicy(PolicyType.PASSWORD, policy);
+            createPolicy(policy);
             fail();
         } catch (SyncopeClientCompositeErrorException sccee) {
             assertNotNull(sccee.getException(SyncopeClientExceptionType.InvalidPasswordPolicy));
@@ -92,7 +92,7 @@ public class PolicyTestITCase extends Ab
         policy.setSpecification(new SyncPolicySpec());
 
         try {
-            createPolicy(PolicyType.SYNC, policy);
+            createPolicy(policy);
             fail();
         } catch (SyncopeClientCompositeErrorException sccee) {
             assertNotNull(sccee.getException(SyncopeClientExceptionType.InvalidSyncPolicy));
@@ -103,7 +103,7 @@ public class PolicyTestITCase extends Ab
     public void create() {
         SyncPolicyTO policy = buildSyncPolicyTO();
 
-        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);
+        SyncPolicyTO policyTO = createPolicy(policy);
 
         assertNotNull(policyTO);
         assertEquals(PolicyType.SYNC, policyTO.getType());
@@ -113,17 +113,17 @@ public class PolicyTestITCase extends Ab
     @Test
     public void update() {
         // get global password
-        PasswordPolicyTO globalPolicy = policyService.read(PolicyType.PASSWORD, 2L);
+        PasswordPolicyTO globalPolicy = policyService.read(2L);
 
         PasswordPolicyTO policy = new PasswordPolicyTO();
         policy.setDescription("A simple password policy");
         policy.setSpecification(globalPolicy.getSpecification());
 
         // create a new password policy using global password as a template
-        policy = createPolicy(PolicyType.PASSWORD, policy);
+        policy = createPolicy(policy);
 
         // read new password policy
-        policy = policyService.read(PolicyType.PASSWORD, policy.getId());
+        policy = policyService.read(policy.getId());
 
         assertNotNull("find to update did not work", policy);
 
@@ -132,8 +132,8 @@ public class PolicyTestITCase extends Ab
         policy.setSpecification(policySpec);
 
         // update new password policy
-        policyService.update(PolicyType.PASSWORD, policy.getId(), policy);
-        policy = policyService.read(PolicyType.PASSWORD, policy.getId());
+        policyService.update(policy.getId(), policy);
+        policy = policyService.read(policy.getId());
 
         assertNotNull(policy);
         assertEquals(PolicyType.PASSWORD, policy.getType());
@@ -145,14 +145,14 @@ public class PolicyTestITCase extends Ab
     public void delete() {
         SyncPolicyTO policy = buildSyncPolicyTO();
 
-        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);
+        SyncPolicyTO policyTO = createPolicy(policy);
         assertNotNull(policyTO);
 
-        policyService.delete(PolicyType.SYNC, policyTO.getId());
+        policyService.delete(policyTO.getId());
 
         Throwable t = null;
         try {
-            policyService.read(PolicyType.SYNC, policyTO.getId());
+            policyService.read(policyTO.getId());
         } catch (SyncopeClientCompositeErrorException e) {
             t = e;
         }
@@ -162,7 +162,7 @@ public class PolicyTestITCase extends Ab
 
     @Test
     public void getCorrelationRules() {
-        assertEquals(1, policyService.getSyncCorrelationRuleClasses(PolicyType.SYNC).size());
+        assertEquals(1, policyService.getSyncCorrelationRuleClasses().size());
     }
 
     private SyncPolicyTO buildSyncPolicyTO() {

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java Thu Jul 25 14:26:38 2013
@@ -53,7 +53,6 @@ import org.apache.syncope.common.to.Task
 import org.apache.syncope.common.to.AbstractTaskTO;
 import org.apache.syncope.common.to.UserTO;
 import org.apache.syncope.common.types.IntMappingType;
-import org.apache.syncope.common.types.PolicyType;
 import org.apache.syncope.common.types.PropagationTaskExecStatus;
 import org.apache.syncope.common.types.TaskType;
 import org.apache.syncope.common.types.TraceLevel;
@@ -111,7 +110,7 @@ public class TaskTestITCase extends Abst
         SyncTaskTO actual = getObject(response, SyncTaskTO.class, taskService);
         assertNotNull(actual);
 
-        task = taskService.read(TaskType.SYNCHRONIZATION, actual.getId());
+        task = taskService.read(actual.getId());
         assertNotNull(task);
         assertEquals(actual.getId(), task.getId());
         assertEquals(actual.getJobClassName(), task.getJobClassName());
@@ -121,7 +120,7 @@ public class TaskTestITCase extends Abst
 
     @Test
     public void update() {
-        SchedTaskTO task = taskService.read(TaskType.SCHEDULED, SCHED_TASK_ID);
+        SchedTaskTO task = taskService.read(SCHED_TASK_ID);
         assertNotNull(task);
 
         SchedTaskTO taskMod = new SchedTaskTO();
@@ -129,7 +128,7 @@ public class TaskTestITCase extends Abst
         taskMod.setCronExpression(null);
 
         taskService.update(taskMod.getId(), taskMod);
-        SchedTaskTO actual = taskService.read(TaskType.SCHEDULED, taskMod.getId());
+        SchedTaskTO actual = taskService.read(taskMod.getId());
         assertNotNull(actual);
         assertEquals(task.getId(), actual.getId());
         assertNull(actual.getCronExpression());
@@ -182,7 +181,7 @@ public class TaskTestITCase extends Abst
 
     @Test
     public void read() {
-        PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, 3L);
+        PropagationTaskTO taskTO = taskService.read(3L);
 
         assertNotNull(taskTO);
         assertNotNull(taskTO.getExecutions());
@@ -251,7 +250,7 @@ public class TaskTestITCase extends Abst
             assertNotNull(usersPre);
 
             // Update sync task
-            SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, SYNC_TASK_ID);
+            SyncTaskTO task = taskService.read(SYNC_TASK_ID);
             assertNotNull(task);
 
             // add custom SyncJob actions
@@ -271,7 +270,7 @@ public class TaskTestITCase extends Abst
             task.setUserTemplate(template);
 
             taskService.update(task.getId(), task);
-            SyncTaskTO actual = taskService.read(TaskType.SYNCHRONIZATION, task.getId());
+            SyncTaskTO actual = taskService.read(task.getId());
             assertNotNull(actual);
             assertEquals(task.getId(), actual.getId());
             assertEquals(TestSyncActions.class.getName(), actual.getActionsClassName());
@@ -329,7 +328,7 @@ public class TaskTestITCase extends Abst
     @Test
     public void reconcileFromDB() {
         // update sync task
-        SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, 7L);
+        SyncTaskTO task = taskService.read(7L);
         assertNotNull(task);
 
         // add user template
@@ -342,7 +341,7 @@ public class TaskTestITCase extends Abst
         task.setUserTemplate(template);
 
         taskService.update(task.getId(), task);
-        SyncTaskTO actual = taskService.read(TaskType.SYNCHRONIZATION, task.getId());
+        SyncTaskTO actual = taskService.read(task.getId());
         assertNotNull(actual);
         assertEquals(task.getId(), actual.getId());
         assertEquals(template, actual.getUserTemplate());
@@ -375,7 +374,7 @@ public class TaskTestITCase extends Abst
     public void reconcileFromLDAP()
             throws InvalidSearchConditionException {
         // Update sync task
-        SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, 11L);
+        SyncTaskTO task = taskService.read(11L);
         assertNotNull(task);
 
         //  add user template
@@ -386,7 +385,7 @@ public class TaskTestITCase extends Abst
         task.setRoleTemplate(template);
 
         taskService.update(task.getId(), task);
-        SyncTaskTO actual = taskService.read(TaskType.SYNCHRONIZATION, task.getId());
+        SyncTaskTO actual = taskService.read(task.getId());
         assertNotNull(actual);
         assertEquals(task.getId(), actual.getId());
         assertEquals(template, actual.getRoleTemplate());
@@ -470,7 +469,7 @@ public class TaskTestITCase extends Abst
                 } catch (InterruptedException e) {
                 }
 
-                taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getId());
+                taskTO = taskService.read(taskTO.getId());
 
                 assertNotNull(taskTO);
                 assertNotNull(taskTO.getExecutions());
@@ -500,7 +499,7 @@ public class TaskTestITCase extends Abst
             assertNotNull(execution);
 
             // 4. verify
-            taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getId());
+            taskTO = taskService.read(taskTO.getId());
             assertNotNull(taskTO);
             assertEquals(1, taskTO.getExecutions().size());
         } finally {
@@ -608,13 +607,13 @@ public class TaskTestITCase extends Abst
             //-----------------------------
 
             // Update sync task
-            SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, 9L);
+            SyncTaskTO task = taskService.read(9L);
             assertNotNull(task);
 
             task.setUserTemplate(template);
 
             taskService.update(task.getId(), task);
-            SyncTaskTO actual = taskService.read(TaskType.SYNCHRONIZATION, task.getId());
+            SyncTaskTO actual = taskService.read(task.getId());
             assertNotNull(actual);
             assertEquals(task.getId(), actual.getId());
             assertFalse(actual.getUserTemplate().getResources().isEmpty());
@@ -649,7 +648,7 @@ public class TaskTestITCase extends Abst
         assertEquals("issueSYNCOPE144", actual.getName());
         assertEquals("issueSYNCOPE144 Description", actual.getDescription());
 
-        task = taskService.read(TaskType.SCHEDULED, actual.getId());
+        task = taskService.read(actual.getId());
         assertNotNull(task);
         assertEquals("issueSYNCOPE144", task.getName());
         assertEquals("issueSYNCOPE144 Description", task.getDescription());
@@ -693,7 +692,7 @@ public class TaskTestITCase extends Abst
     private TaskExecTO execSyncTask(final Long taskId, final int maxWaitSeconds,
             final boolean dryRun) {
 
-        AbstractTaskTO taskTO = taskService.read(TaskType.SYNCHRONIZATION, taskId);
+        AbstractTaskTO taskTO = taskService.read(taskId);
         assertNotNull(taskTO);
         assertNotNull(taskTO.getExecutions());
 
@@ -711,7 +710,7 @@ public class TaskTestITCase extends Abst
             } catch (InterruptedException e) {
             }
 
-            taskTO = taskService.read(TaskType.SYNCHRONIZATION, taskTO.getId());
+            taskTO = taskService.read(taskTO.getId());
 
             assertNotNull(taskTO);
             assertNotNull(taskTO.getExecutions());
@@ -739,7 +738,7 @@ public class TaskTestITCase extends Abst
             assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
 
             // update sync task
-            SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, SYNC_TASK_ID);
+            SyncTaskTO task = taskService.read(SYNC_TASK_ID);
             assertNotNull(task);
 
             // add user template
@@ -758,7 +757,7 @@ public class TaskTestITCase extends Abst
             task.setUserTemplate(template);
 
             taskService.update(task.getId(), task);
-            SyncTaskTO actual = taskService.read(TaskType.SYNCHRONIZATION, task.getId());
+            SyncTaskTO actual = taskService.read(task.getId());
             assertNotNull(actual);
             assertEquals(task.getId(), actual.getId());
 
@@ -782,10 +781,10 @@ public class TaskTestITCase extends Abst
         // -----------------------------
         // Add a custom correlation rule
         // -----------------------------
-        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 9L);
+        SyncPolicyTO policyTO = policyService.read(9L);
         policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());
 
-        policyService.update(PolicyType.SYNC, policyTO.getId(), policyTO);
+        policyService.update(policyTO.getId(), policyTO);
         // -----------------------------
 
         SyncTaskTO task = new SyncTaskTO();
@@ -822,7 +821,7 @@ public class TaskTestITCase extends Abst
 
         execSyncTask(actual.getId(), 50, false);
 
-        SyncTaskTO executed = taskService.read(TaskType.SYNCHRONIZATION, actual.getId());
+        SyncTaskTO executed = taskService.read(actual.getId());
         assertEquals(1, executed.getExecutions().size());
 
         // asser for just one match
@@ -849,7 +848,7 @@ public class TaskTestITCase extends Abst
         assertEquals("virtualvalue", userTO.getVirtualAttributeMap().get("virtualdata").getValues().get(0));
 
         // Update sync task
-        SyncTaskTO task = taskService.read(TaskType.SYNCHRONIZATION, 12L);
+        SyncTaskTO task = taskService.read(12L);
         assertNotNull(task);
 
         //  add user template

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java?rev=1506985&r1=1506984&r2=1506985&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Thu Jul 25 14:26:38 2013
@@ -173,7 +173,7 @@ public class UserTestITCase extends Abst
         assertTrue(newMaxId > maxId);
 
         // get last task
-        PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, newMaxId);
+        PropagationTaskTO taskTO = taskService.read(newMaxId);
 
         assertNotNull(taskTO);
         assertTrue(taskTO.getExecutions().isEmpty());
@@ -183,7 +183,7 @@ public class UserTestITCase extends Abst
     public void issue172() {
         List<PasswordPolicyTO> policies = policyService.list(PolicyType.GLOBAL_PASSWORD);
         for (PasswordPolicyTO policyTO : policies) {
-            policyService.delete(PolicyType.GLOBAL_PASSWORD, policyTO.getId());
+            policyService.delete(policyTO.getId());
         }
 
         try {
@@ -191,7 +191,7 @@ public class UserTestITCase extends Abst
             createUser(userTO);
         } finally {
             for (PasswordPolicyTO policyTO : policies) {
-                Response response = policyService.create(PolicyType.GLOBAL_PASSWORD, policyTO);
+                Response response = policyService.create(policyTO);
                 AbstractPolicyTO cPolicyTO = getObject(response, PasswordPolicyTO.class, policyService);
                 assertNotNull(cPolicyTO);
             }
@@ -386,7 +386,7 @@ public class UserTestITCase extends Abst
         assertFalse(tasks.isEmpty());
 
         long maxId = getMaxTaskId(tasks);
-        PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, maxId);
+        PropagationTaskTO taskTO = taskService.read(maxId);
 
         assertNotNull(taskTO);
         int maxTaskExecutions = taskTO.getExecutions().size();
@@ -448,7 +448,7 @@ public class UserTestITCase extends Abst
         assertEquals(newMaxId, maxId);
 
         // get last task
-        taskTO = taskService.read(TaskType.PROPAGATION, newMaxId);
+        taskTO = taskService.read(newMaxId);
 
         assertNotNull(taskTO);
         assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
@@ -995,7 +995,7 @@ public class UserTestITCase extends Abst
         // all update executions have to be registered
         assertTrue(newMaxId > maxId);
 
-        final PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, newMaxId);
+        final PropagationTaskTO taskTO = taskService.read(newMaxId);
 
         assertNotNull(taskTO);
         assertEquals(1, taskTO.getExecutions().size());



Mime
View raw message