summaryrefslogtreecommitdiffstats
path: root/common-app-api/src/test
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2020-01-29 17:25:21 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-04-19 16:35:32 +0000
commitcd6f933375c412c2f79a12e909821322d58a8499 (patch)
tree758ff2e742b514169bbc84a8433d68fe221ef5c9 /common-app-api/src/test
parentdc56692a4a307f378c827f017d2efbf754c223e0 (diff)
Configure a new Artifact Type
Centralizes artifact configuration in one yaml entry. Allow the configuration of a new artifact type without the need of code changes. The configuration file now is used as a source of artifacts types instead the artifact type enum. The enum will be used as a source of base artifact types and also in hard coded business rules. Change-Id: Id0383d9fca9bce0519a4d52a4ecb3a68c8713f0f Issue-ID: SDC-2754 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'common-app-api/src/test')
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java47
1 files changed, 20 insertions, 27 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java
index 86cdeaafa8..86f1f86bb0 100644
--- a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java
+++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java
@@ -20,43 +20,36 @@
package org.openecomp.sdc.common.api;
-import java.util.List;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.nullValue;
import org.junit.Test;
public class ArtifactTypeEnumTest {
-
- private ArtifactTypeEnum createTestSubject() {
- return ArtifactTypeEnum.AAI_SERVICE_MODEL;
- }
-
@Test
- public void testGetType() throws Exception {
- ArtifactTypeEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getType();
+ public void testGetType() {
+ assertThat("The artifact type should match", ArtifactTypeEnum.WORKFLOW.getType(), is("WORKFLOW"));
+ assertThat("The artifact type should match", ArtifactTypeEnum.OTHER.getType(), is("OTHER"));
+ assertThat("The artifact type should match", ArtifactTypeEnum.HEAT.getType(), is("HEAT"));
}
@Test
- public void testFindType() throws Exception {
- String type = "";
- ArtifactTypeEnum result;
-
- // default test
- result = ArtifactTypeEnum.findType(type);
+ public void testParse() {
+ ArtifactTypeEnum actual = ArtifactTypeEnum.parse("HEAT");
+ assertThat("The artifact type should not be null", actual, notNullValue());
+ assertThat("The artifact type should match", actual, is(ArtifactTypeEnum.HEAT));
+ actual = ArtifactTypeEnum.parse("OTHER");
+ assertThat("The artifact type should not be null", actual, notNullValue());
+ assertThat("The artifact type should match", actual, is(ArtifactTypeEnum.OTHER));
+ actual = ArtifactTypeEnum.parse("WORKFLOW");
+ assertThat("The artifact type should not be null", actual, notNullValue());
+ assertThat("The artifact type should match", actual, is(ArtifactTypeEnum.WORKFLOW));
+ actual = ArtifactTypeEnum.parse("anyNotKnownType");
+ assertThat("The artifact type should be null", actual, nullValue());
}
-
- @Test
- public void testGetAllTypes() throws Exception {
- List<String> result;
-
- // default test
- result = ArtifactTypeEnum.getAllTypes();
- }
}