aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/test/java
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2023-08-11 15:10:44 +0100
committeradheli.tavares <adheli.tavares@est.tech>2023-09-25 13:40:52 +0100
commit4407ea6948a060734a4f2836b11bd2d5c6ea6194 (patch)
tree6a6e482126ec3d8e830faf80a392b2161ced6de0 /models/src/test/java
parentc4b3c527882610afc3f08c0efd73e2f7841e9fe5 (diff)
Upgrade Java 17
Issue-ID: POLICY-4673 Change-Id: I01fd3677687b5d2e065d0cc131b338ed841d7e99 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'models/src/test/java')
-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;