diff options
Diffstat (limited to 'catalog-be/src/test/java')
4 files changed, 77 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ForwardingPathsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ForwardingPathsTest.java new file mode 100644 index 0000000000..ba5f4cb0a7 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ForwardingPathsTest.java @@ -0,0 +1,21 @@ +package org.openecomp.sdc.be.datamodel; + +import org.junit.Test; + +import java.util.Set; +import java.util.*; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ForwardingPathsTest { + + @Test + public void testForwardingPaths() { + ForwardingPaths testForwardingPaths = new ForwardingPaths(); + Set<String> path= new HashSet<>(Arrays.asList("test")); + testForwardingPaths.setForwardingPathToDelete(path); + Set<String> getPath = testForwardingPaths.getForwardingPathToDelete(); + assertThat(getPath).isEqualTo(path); + } + +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairTest.java index f2a468207b..cc6c03bdd5 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairTest.java @@ -21,6 +21,16 @@ public class NameIdPairTest { } @Test + public void testConstructorWith3Parameters() throws Exception { + NameIdPair testSubject; + String result; + + // default test + testSubject = new NameIdPair("", "",""); + result = testSubject.getOwnerId(); + } + + @Test public void testSetName() throws Exception { NameIdPair testSubject; String name = ""; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairWrapperTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairWrapperTest.java index 452d02d3ea..4f6e7cace4 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairWrapperTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/NameIdPairWrapperTest.java @@ -20,6 +20,15 @@ public class NameIdPairWrapperTest { } @Test + public void testInitWithObject() throws Exception { + NameIdPairWrapper testSubject; + NameIdPair nameIdPair = new NameIdPair("mock", "mock"); + + // default test + testSubject = new NameIdPairWrapper(nameIdPair); + } + + @Test public void testGetId() throws Exception { NameIdPairWrapper testSubject; String result; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ServiceRelationsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ServiceRelationsTest.java new file mode 100644 index 0000000000..dc89f1ed37 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/ServiceRelationsTest.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.be.datamodel; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ServiceRelationsTest { + + private NameIdPair getNameIdPairWrapper() { + return new NameIdPair("mock", "mock"); + } + + @Test + public void testServiceRelations() { + + NameIdPairWrapper testNameIdPairWrapper; + NameIdPair nameIdPair = new NameIdPair("mock", "mock"); + + testNameIdPairWrapper = new NameIdPairWrapper(); + testNameIdPairWrapper.init(nameIdPair); + + Set<NameIdPairWrapper> result = new HashSet<NameIdPairWrapper>(); + result.add(testNameIdPairWrapper); + + + ServiceRelations testServiceRelations = new ServiceRelations(); + ServiceRelations testServiceRelationsWithRelations = new ServiceRelations(result); + testServiceRelations.setRelations(result); + Set<NameIdPairWrapper> getResult = testServiceRelations.getRelations(); + assertThat(getResult).isEqualTo(result); + } + +}
\ No newline at end of file |