diff --git a/source/java/org/alfresco/rest/api/impl/AuditImpl.java b/source/java/org/alfresco/rest/api/impl/AuditImpl.java index ac120bff86..7abaa86665 100644 --- a/source/java/org/alfresco/rest/api/impl/AuditImpl.java +++ b/source/java/org/alfresco/rest/api/impl/AuditImpl.java @@ -187,7 +187,9 @@ public class AuditImpl implements Audit Pair sortProp = getAuditEntrySortProp(parameters); Boolean forward = true; if ((sortProp != null) && (sortProp.getFirst().equals(CREATED_AT))) + { forward = sortProp.getSecond(); + } // Parse where clause properties. List entriesAudit = new ArrayList(); diff --git a/source/test-java/org/alfresco/rest/api/tests/AuditAppTest.java b/source/test-java/org/alfresco/rest/api/tests/AuditAppTest.java index 542a9192f3..1a4a55d9ac 100644 --- a/source/test-java/org/alfresco/rest/api/tests/AuditAppTest.java +++ b/source/test-java/org/alfresco/rest/api/tests/AuditAppTest.java @@ -99,10 +99,14 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest final AuditApps auditAppsProxy = publicApiClient.auditApps(); String appId = null; - // Get one of the audit app ids (default tagging) + // Get one of the audit app ids setRequestContext(networkOne.getId(), networkAdmin, DEFAULT_ADMIN_PWD); ListResponse apps = auditAppsProxy.getAuditApps(null, "Getting audit apps error ", HttpServletResponse.SC_OK); - appId = (apps.getList().size()>0) ? apps.getList().get(0).getId() : "tagging"; + if (apps.getList().size() == 0) + { + fail("There are no audit applications to run this test against."); + } + appId = apps.getList().get(0).getId(); // Enable system audit AuthenticationUtil.setFullyAuthenticatedUser(networkAdmin); @@ -140,10 +144,8 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest // Positive tests // Get audit application information { - // Get the list of audit applications in the system setRequestContext(networkOne.getId(), networkAdmin, DEFAULT_ADMIN_PWD); - // Get audit application info AuditApp auditApp = auditAppsProxy.getAuditApp(appId); validateAuditApplicationFields(auditApp); } @@ -251,7 +253,10 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest //Get one of the audit app ids ( fail test if there are no audit apps in the system ) ListResponse apps = publicApiClient.auditApps().getAuditApps(null, "Getting audit apps error ", HttpServletResponse.SC_OK); - if (apps.getList().size() == 0) fail("There are no audit applications to run this test against."); + if (apps.getList().size() == 0) + { + fail("There are no audit applications to run this test against."); + } appId = apps.getList().get(0).getId(); // +ve