summaryrefslogtreecommitdiffstats
path: root/models-provider
diff options
context:
space:
mode:
Diffstat (limited to 'models-provider')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java6
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java6
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java2
-rw-r--r--models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java2
4 files changed, 8 insertions, 8 deletions
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java
index a0c5ce678..dc0a1f62e 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java
@@ -69,17 +69,17 @@ public abstract class AbstractModelsProvider implements Closeable {
parameters.getPersistenceUnit());
if (pfDao != null) {
- String errorMessage = "provider is already initialized";
+ var errorMessage = "provider is already initialized";
throw new PfModelException(Response.Status.NOT_ACCEPTABLE, errorMessage);
}
// Parameters for the DAO
- final DaoParameters daoParameters = new DaoParameters();
+ final var daoParameters = new DaoParameters();
daoParameters.setPluginClass(DefaultPfDao.class.getName());
daoParameters.setPersistenceUnit(parameters.getPersistenceUnit());
// @formatter:off
- Properties jdbcProperties = new Properties();
+ var jdbcProperties = new Properties();
jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_DRIVER, parameters.getDatabaseDriver());
jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_URL, parameters.getDatabaseUrl());
jdbcProperties.setProperty(PersistenceUnitProperties.JDBC_USER, parameters.getDatabaseUser());
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
index 1839604aa..a90dc895c 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
@@ -146,7 +146,7 @@ public class DatabasePolicyModelsProviderImpl extends AbstractModelsProvider imp
throws PfModelException {
assertInitialized();
- ToscaConceptIdentifier policyTypeIdentifier = new ToscaConceptIdentifier(name, version);
+ var policyTypeIdentifier = new ToscaConceptIdentifier(name, version);
assertPolicyTypeNotSupportedInPdpGroup(policyTypeIdentifier);
return new AuthorativeToscaProvider().deletePolicyType(getPfDao(), name, version);
@@ -197,7 +197,7 @@ public class DatabasePolicyModelsProviderImpl extends AbstractModelsProvider imp
throws PfModelException {
assertInitialized();
- ToscaConceptIdentifier policyIdentifier = new ToscaConceptIdentifier(name, version);
+ var policyIdentifier = new ToscaConceptIdentifier(name, version);
assertPolicyNotDeployedInPdpGroup(policyIdentifier);
return new AuthorativeToscaProvider().deletePolicy(getPfDao(), name, version);
@@ -314,7 +314,7 @@ public class DatabasePolicyModelsProviderImpl extends AbstractModelsProvider imp
*/
private void assertInitialized() {
if (getPfDao() == null) {
- String errorMessage = "policy models provider is not initilaized";
+ var errorMessage = "policy models provider is not initilaized";
throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
}
}
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
index 07617aad9..f47f4d464 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
@@ -274,7 +274,7 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
* @return the ToscaServiceTemplate with the dummy response
*/
protected ToscaServiceTemplate getDummyResponse(final String fileName) {
- StandardCoder standardCoder = new StandardCoder();
+ var standardCoder = new StandardCoder();
ToscaServiceTemplate serviceTemplate;
try {
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
index a1102cb51..9e8ba0bbc 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
@@ -412,7 +412,7 @@ public class DatabasePolicyModelsProviderTest {
List<PdpStatistics> statisticsArrayList = makePdpStatisticsList();
- assertThat(databaseProvider.getPdpStatistics(null, null)).hasSize(0);
+ assertThat(databaseProvider.getPdpStatistics(null, null)).isEmpty();
assertThat(databaseProvider.createPdpStatistics(statisticsArrayList)).hasSize(1);
assertThat(databaseProvider.updatePdpStatistics(statisticsArrayList)).hasSize(1);
}