aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-08-11 15:10:44 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-08-18 10:18:26 +0100
commitcee4b8ae2fc1729d3eec086e0d48e9914fa69006 (patch)
treebd0279f048ae411e87ce949fbdfcde4cb5a321f2 /models/src/test
parentaf691618ebd408111c87224e389d27ea8f9bcf46 (diff)
Upgrade Java 17
Issue-ID: POLICY-4673 Change-Id: Ib09bda7db30f53b01b2ea205ad04e5851217da78 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src/test')
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementTest.java3
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformationTest.java2
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantsSupportedElementTypesTest.java2
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java2
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java9
-rwxr-xr-x[-rw-r--r--]models/src/test/java/org/onap/policy/clamp/models/acm/rest/RestUtilsTest.java2
6 files changed, 9 insertions, 11 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementTest.java
index e044a2f22..f29858fbb 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/AutomationCompositionElementTest.java
@@ -34,7 +34,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
class AutomationCompositionElementTest {
@Test
void testAutomationCompositionElement() {
- assertNotNull(new AutomationCompositionElement());
var ace0 = new AutomationCompositionElement();
var ace1 = new AutomationCompositionElement(ace0);
assertEquals(ace0, ace1);
@@ -54,7 +53,7 @@ class AutomationCompositionElementTest {
assertThat(ace0.toString()).contains("AutomationCompositionElement(");
assertThat(ace0.hashCode()).isNotZero();
- assertEquals(ace0, ace0);
+ assertThat(ace0).isEqualTo(ace0);
assertNotEquals(null, ace0);
var ace1 = new AutomationCompositionElement();
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformationTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformationTest.java
index 4c01f659c..fd06b3941 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformationTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantInformationTest.java
@@ -26,7 +26,7 @@ import java.util.HashMap;
import java.util.UUID;
import org.junit.jupiter.api.Test;
-public class ParticipantInformationTest {
+class ParticipantInformationTest {
@Test
void testCopyConstructor() {
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantsSupportedElementTypesTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantsSupportedElementTypesTest.java
index 5a82466d6..827daf035 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantsSupportedElementTypesTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/concepts/ParticipantsSupportedElementTypesTest.java
@@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.UUID;
import org.junit.jupiter.api.Test;
-public class ParticipantsSupportedElementTypesTest {
+class ParticipantsSupportedElementTypesTest {
private static final String ID = "a95757ba-b34a-4049-a2a8-46773abcbe5e";
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java
index 2faf9e17a..8afb5aead 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java
@@ -32,7 +32,7 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType
/**
* Test the {@link JpaParticipantSupportedElementType} class.
*/
-public class JpaParticipantSupportedElementTypeTest {
+class JpaParticipantSupportedElementTypeTest {
private static final String NULL_PARTICIPANT_ID_ERROR = "participantId is marked .*ull but is null";
private static final String NULL_ID_ERROR = "id is marked .*ull but is null";
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java
index b479f022f..f907892f9 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java
@@ -90,11 +90,12 @@ class AcDefinitionProviderTest {
var result = acDefinitionProvider.createAutomationCompositionDefinition(inputServiceTemplate);
assertThat(result.getServiceTemplate()).isEqualTo(docServiceTemplate.toAuthorative());
- assertThat(result.getServiceTemplate().getMetadata() != null);
+ assertThat(result.getServiceTemplate().getMetadata()).isNotNull();
}
@Test
void testCreateServiceTemplateWithMetadata() {
+ inputServiceTemplate.setMetadata(new HashMap<>());
var docServiceTemplate = new DocToscaServiceTemplate(inputServiceTemplate);
var acmDefinition = getAcDefinition(docServiceTemplate);
@@ -103,11 +104,10 @@ class AcDefinitionProviderTest {
.thenReturn(new JpaAutomationCompositionDefinition(acmDefinition));
var acDefinitionProvider = new AcDefinitionProvider(acmDefinitionRepository);
- inputServiceTemplate.setMetadata(new HashMap<>());
var result = acDefinitionProvider.createAutomationCompositionDefinition(inputServiceTemplate);
assertThat(result.getServiceTemplate()).isEqualTo(docServiceTemplate.toAuthorative());
- assertThat(result.getServiceTemplate().getMetadata() != null);
+ assertThat(result.getServiceTemplate().getMetadata()).isNotNull();
}
@Test
@@ -234,8 +234,7 @@ class AcDefinitionProviderTest {
result = acDefinitionProvider.getServiceTemplateList(null,
null);
- assertThat(result).hasSize(0);
- assertThat(result.isEmpty());
+ assertThat(result).isEmpty();
}
private AutomationCompositionDefinition getAcDefinition(DocToscaServiceTemplate docServiceTemplate) {
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/rest/RestUtilsTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/rest/RestUtilsTest.java
index a62f78ba2..e6135fe5b 100644..100755
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/rest/RestUtilsTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/rest/RestUtilsTest.java
@@ -22,7 +22,7 @@ package org.onap.policy.clamp.models.acm.rest;
import static org.assertj.core.api.Assertions.assertThat;
-import javax.ws.rs.core.Response.Status;
+import jakarta.ws.rs.core.Response.Status;
import org.junit.jupiter.api.Test;
import org.onap.policy.models.errors.concepts.ErrorResponse;
import org.onap.policy.models.errors.concepts.ErrorResponseInfo;