From ce8522a2c155afbbe1624bf006bf57cd88b7094e Mon Sep 17 00:00:00 2001 From: cagache Date: Thu, 11 Apr 2019 17:33:26 +0300 Subject: [PATCH] refactoring --- .../rm/community/base/BaseRMRestTest.java | 20 +++++++++---------- .../recordfolders/ElectronicRecordTests.java | 8 ++++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index aa65f8c967..e2b5b8f2a9 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -141,7 +141,7 @@ public class BaseRMRestTest extends RestTest /** Valid root containers where electronic and non-electronic records can be created */ @DataProvider(name = "validRootContainers") - public String[][] getValidRootContainers() throws Exception + public Object[][] getValidRootContainers() throws Exception { return new String[][] { @@ -655,19 +655,17 @@ public class BaseRMRestTest extends RestTest try { this.wait(waitInMilliSeconds); - } catch (InterruptedException e) + } + catch (InterruptedException e) { } } List searchResults = getRestAPIFactory().getRmRestWrapper().withSearchAPI().search(query) .getEntries(); - if ((searchResults != null && !searchResults.isEmpty())) + if (searchResults != null && !searchResults.isEmpty()) { - searchResults.forEach(childNode -> - { - names.add(childNode.onModel().getName()); - }); + searchResults.forEach(childNode -> names.add(childNode.onModel().getName())); break; } else @@ -675,7 +673,7 @@ public class BaseRMRestTest extends RestTest counter++; } // double wait time to not overdo solr search - waitInMilliSeconds = (waitInMilliSeconds * 2); + waitInMilliSeconds = waitInMilliSeconds * 2; } return names; } @@ -711,8 +709,8 @@ public class BaseRMRestTest extends RestTest } } - results = searchApi.searchForNodeNamesAsUser(user.getUsername(), user.getPassword(), term, sortby, - includeFolders, includeCategories); + results = searchApi.searchForNodeNamesAsUser(user.getUsername(), user.getPassword(), term, sortby, + includeFolders, includeCategories); if (!results.isEmpty() && results.containsAll(expectedResults)) { break; @@ -722,7 +720,7 @@ public class BaseRMRestTest extends RestTest counter++; } // double wait time to not overdo solr search - waitInMilliSeconds = (waitInMilliSeconds * 2); + waitInMilliSeconds = waitInMilliSeconds * 2; } return results; } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java index 38dc9d8cc2..7768ce95b8 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordfolders/ElectronicRecordTests.java @@ -71,7 +71,7 @@ public class ElectronicRecordTests extends BaseRMRestTest /** Invalid parent containers where electronic records can't be created */ @DataProvider(name = "invalidParentContainers") - public Object[][] invalidParentContainers() throws Exception + public Object[][] invalidParentContainers() { return new String[][] { @@ -99,7 +99,7 @@ public class ElectronicRecordTests extends BaseRMRestTest dataProvider = "invalidParentContainers", description = "Electronic records can't be created in invalid parent containers" ) - public void cantCreateElectronicRecordsInInvalidContainers(String container) throws Exception + public void cantCreateElectronicRecordsInInvalidContainers(String container) { // Create an electronic record in the given container, this should throw an IllegalArgumentException getRestAPIFactory().getRecordFolderAPI().createRecord(createElectronicRecordModel(), container, getFile(IMAGE_FILE)); @@ -158,7 +158,7 @@ public class ElectronicRecordTests extends BaseRMRestTest * Then nothing happens * And an error is reported * - * @param folderid The folder, which the record will be created in + * @param folderId The folder, which the record will be created in * @param type The type of the record folder, which the record will be created in * @throws Exception if record can't be created */ @@ -405,7 +405,7 @@ public class ElectronicRecordTests extends BaseRMRestTest */ @Test(description = "Electronic records can be created in record folder with duplicate name") @Bug(id ="RM-5116, RM-5012") - public void canCreateElectronicRecordsWithDuplicateName() throws Exception + public void canCreateElectronicRecordsWithDuplicateName() { RecordCategoryChild recordFolder = createCategoryFolderInFilePlan();