Merge branch 'feature/RM-7081_ReduceAutomationProjSonarIssues' into 'master'

RM-7081 Reduce automation proj sonar issues

Closes RM-7081

See merge request records-management/records-management!1337
This commit is contained in:
Claudia Agache
2019-12-20 14:49:19 +00:00
10 changed files with 14 additions and 11 deletions

View File

@@ -559,7 +559,7 @@
<maven.tomcat.port>8080</maven.tomcat.port>
<jackson.version>2.9.9</jackson.version>
<jackson-databind.version>2.9.10</jackson-databind.version>
<jackson-databind.version>2.9.10.1</jackson-databind.version>
<fabric8.docker.version>0.31.0</fabric8.docker.version>
<mockito.version>1.10.19</mockito.version>
<postgresql.version>42.2.6</postgresql.version>

View File

@@ -109,7 +109,7 @@ public class Record extends TestModel implements IRestModel<RestNodeModel>
@Override
public ModelAssertion<RestNodeModel> assertThat()
{
return new ModelAssertion<RestNodeModel>(this);
return new ModelAssertion<>(this);
}
@Override

View File

@@ -53,7 +53,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class RecordCategory extends TestModel
{
public final static String DEFAULT_FILE_PLAN_ALIAS = "-filePlan-";
public static final String DEFAULT_FILE_PLAN_ALIAS = "-filePlan-";
/*************************/
/** Mandatory parameters */

View File

@@ -53,7 +53,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class RecordCategoryChild extends TestModel
{
public final static String RECORD_FOLDER_NODE_TYPE = "rma:recordFolder";
public static final String RECORD_FOLDER_NODE_TYPE = "rma:recordFolder";
/*************************/
/** Mandatory parameters */

View File

@@ -28,7 +28,6 @@ package org.alfresco.rest.rm.community.requests.gscore.api;
import static org.alfresco.rest.core.RestRequest.simpleRequest;
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.springframework.http.HttpMethod.POST;
import org.alfresco.rest.core.RMRestWrapper;

View File

@@ -54,6 +54,10 @@ public class PojoUtility
*/
private static final Logger LOGGER = LoggerFactory.getLogger(PojoUtility.class);
/** Private constructor to prevent instantiation. */
private PojoUtility()
{}
/**
* see {@link #toJson(Object, Class, Class)}
*/
@@ -122,7 +126,7 @@ public class PojoUtility
}
catch (IOException e)
{
LOGGER.error("Unable to convert the json into a java object.", e.toString());
LOGGER.error("Unable to convert the json into a java object.", e);
}
return obj;
@@ -152,7 +156,7 @@ public class PojoUtility
}
catch (IOException e)
{
LOGGER.error("Unable to convert the json array into a java collection.", e.toString());
LOGGER.error("Unable to convert the json array into a java collection.", e);
}

View File

@@ -105,7 +105,7 @@ public class CustomDefinitionsAPI extends BaseAPI
}
catch (JSONException error)
{
LOGGER.error("Unable to get the refId for the custom reference definition " + customDefinition);
LOGGER.error("Unable to get the refId for the custom reference definition {}", customDefinition);
}
}
return null;

View File

@@ -76,7 +76,7 @@ public class RMAuditAPI extends BaseAPI
}
catch (UnsupportedEncodingException e)
{
LOGGER.error("Unable to encode the event name" + e.getMessage());
LOGGER.error("Unable to encode the event name {}", e.getMessage());
}
JSONArray auditEntries = doGetRequest(user, password,
MessageFormat.format(RM_AUDIT_LOG_API,"{0}", parameters)).getJSONObject("data").getJSONArray("entries");

View File

@@ -102,7 +102,7 @@ public class SearchAPI extends BaseAPI
String filters,
String sortby)
{
List<BasicNameValuePair> searchParameters = new ArrayList<BasicNameValuePair>();
List<BasicNameValuePair> searchParameters = new ArrayList<>();
searchParameters.add(new BasicNameValuePair("query", query));
searchParameters.add(new BasicNameValuePair("filters", filters));
if (sortby != null)

View File

@@ -1,2 +1,2 @@
# The scope of this file is to have a custom scan directive for SourceClear excluding automation and benchmark projects from the scan.
custom_maven_command: clean install -Dcheckstyle.skip=true -e -DskipTests -DskipITs -Dmaven.test.skip=true -Denforcer.skip=true -pl '!rm-automation,!rm-automation/rm-automation-community-rest-api,!rm-automation/rm-automation-enterprise-rest-api,!rm-automation/rm-automation-ui,!rm-benchmark'
custom_maven_command: install -Dcheckstyle.skip=true -e -DskipTests -DskipITs -Dmaven.test.skip=true -Denforcer.skip=true -pl '!rm-automation,!rm-automation/rm-automation-community-rest-api,!rm-automation/rm-automation-enterprise-rest-api,!rm-automation/rm-automation-ui,!rm-benchmark'