summaryrefslogtreecommitdiffstats
path: root/catalog-dao
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-dao')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/Account.java73
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategy.java4
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnum.java121
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnum.java41
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnum.java12
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java89
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java98
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategyTest.java50
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java53
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java47
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnumTest.java (renamed from catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/GraphJsonProperty.java)31
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java62
12 files changed, 281 insertions, 400 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/Account.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/Account.java
index 6ff717df92..6a1e495d51 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/Account.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/Account.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,67 +20,24 @@
package org.openecomp.sdc.be.dao;
-//import com.datastax.driver.mapping.annotations.Column;
-//import com.datastax.driver.mapping.annotations.Frozen;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
-import com.google.common.base.Objects;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
@Table(keyspace = "dstest", name = "accounts")
+@Getter
+@Setter
+@EqualsAndHashCode
+@AllArgsConstructor
+@NoArgsConstructor
public class Account {
- @PartitionKey
- private String email;
- private String name;
- // @Column (name = "addr")
- // @Frozen
- // private Address address;
-
- public Account() {
- }
-
- // public Account(String name, String email, Address address) {
- public Account(String name, String email) {
- this.name = name;
- this.email = email;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
- //
- // public Address getAddress() {
- // return address;
- // }
- //
- // public void setAddress(Address address) {
- // this.address = address;
- // }
-
- @Override
- public boolean equals(Object other) {
- if (other instanceof Account) {
- Account that = (Account) other;
- return Objects.equal(this.name, that.name) && Objects.equal(this.email, that.email);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, email);
- }
+ @PartitionKey
+ private String email;
+ private String name;
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategy.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategy.java
index 1a96ebf87b..1f7d6b9c7b 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategy.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategy.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnum.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnum.java
index 9dc9c84466..d35f00b5f8 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnum.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnum.java
@@ -21,68 +21,69 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
public enum EdgeLabelEnum {
- ARTIFACTS,
- DEPLOYMENT_ARTIFACTS,
- INST_DEPLOYMENT_ARTIFACTS,
- INSTANCE_ARTIFACTS,
- INTERFACE_ARTIFACTS,
- TOSCA_ARTIFACTS,
- PROPERTIES,
- CAPABILITIES,
- CAPABILITIES_PROPERTIES,
- REQUIREMENTS,
- ATTRIBUTES,
- ADDITIONAL_INFORMATION,
- CATEGORY,
- DERIVED_FROM,
- STATE,
- LAST_STATE,
- LAST_MODIFIER,
- VERSION,
- CREATOR,
- SUB_CATEGORY,
- INPUTS,
- GROUPS,
- INST_PROPERTIES,
- INST_INPUTS,
- INST_ATTRIBUTES,
- INST_GROUPS,
- SERVICE_API_ARTIFACTS,
- FORWARDING_PATH,
- CALCULATED_CAPABILITIES,
- FULLFILLED_CAPABILITIES,
- CALCULATED_REQUIREMENTS,
- FULLFILLED_REQUIREMENTS,
- LAST_DISTRIBUTION_STATE_MODIFIER,
- CALCULATED_CAP_PROPERTIES,
- POLICIES,
- EXTERNAL_REFS,
- CATALOG_ELEMENT,
+ ARTIFACTS,
+ DEPLOYMENT_ARTIFACTS,
+ INST_DEPLOYMENT_ARTIFACTS,
+ INSTANCE_ARTIFACTS,
+ INTERFACE_ARTIFACTS,
+ TOSCA_ARTIFACTS,
+ PROPERTIES,
+ CAPABILITIES,
+ CAPABILITIES_PROPERTIES,
+ REQUIREMENTS,
+ ATTRIBUTES,
+ ADDITIONAL_INFORMATION,
+ CATEGORY,
+ DERIVED_FROM,
+ STATE,
+ LAST_STATE,
+ LAST_MODIFIER,
+ VERSION,
+ CREATOR,
+ SUB_CATEGORY,
+ INPUTS,
+ GROUPS,
+ INST_PROPERTIES,
+ INST_INPUTS,
+ INST_ATTRIBUTES,
+ INST_GROUPS,
+ SERVICE_API_ARTIFACTS,
+ FORWARDING_PATH,
+ CALCULATED_CAPABILITIES,
+ FULLFILLED_CAPABILITIES,
+ CALCULATED_REQUIREMENTS,
+ FULLFILLED_REQUIREMENTS,
+ LAST_DISTRIBUTION_STATE_MODIFIER,
+ CALCULATED_CAP_PROPERTIES,
+ POLICIES,
+ EXTERNAL_REFS,
+ CATALOG_ELEMENT,
ARCHIVE_ELEMENT,
- INSTANCE_OF,
- PROXY_OF,
- ALLOTTED_OF,
- INTERFACE,
- INTERFACE_OPERATION,
- INST_INTERFACES,
- NODE_FILTER_TEMPLATE,
- DATA_TYPES;
+ INSTANCE_OF,
+ PROXY_OF,
+ ALLOTTED_OF,
+ INTERFACE,
+ INTERFACE_OPERATION,
+ INST_INTERFACES,
+ NODE_FILTER_TEMPLATE,
+ DATA_TYPES;
/**
- * Returns EdgeLabelEnum according received name
- * @param name
- * @return
- */
- public static EdgeLabelEnum getEdgeLabelEnum(String name){
- for(EdgeLabelEnum currLabel : EdgeLabelEnum.values()){
- if (currLabel.name().equals(name)){
- return currLabel;
- }
- }
- return null;
- }
+ * Returns EdgeLabelEnum according received name
+ *
+ * @param name
+ * @return
+ */
+ public static EdgeLabelEnum getEdgeLabelEnum(String name) {
+ for (EdgeLabelEnum currLabel : EdgeLabelEnum.values()) {
+ if (currLabel.name().equals(name)) {
+ return currLabel;
+ }
+ }
+ return null;
+ }
- public boolean isInstanceArtifactsLabel() {
- return this.equals(INSTANCE_ARTIFACTS) || this.equals(INST_DEPLOYMENT_ARTIFACTS);
- }
+ public boolean isInstanceArtifactsLabel() {
+ return this.equals(INSTANCE_ARTIFACTS) || this.equals(INST_DEPLOYMENT_ARTIFACTS);
+ }
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnum.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnum.java
index e47a78d9f0..d2f6d09908 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnum.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnum.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,27 +20,24 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum EdgePropertyEnum {
-
- STATE ("state"),
- INSTANCES("instances");
- private String property;
-
- public String getProperty() {
- return property;
- }
+ STATE("state"),
+ INSTANCES("instances");
+
+ private final String property;
- EdgePropertyEnum (String property){
- this.property = property;
- }
-
- public static EdgePropertyEnum getByProperty(String property){
- for ( EdgePropertyEnum inst : EdgePropertyEnum.values() ){
- if ( inst.getProperty().equals(property) ){
- return inst;
- }
- }
- return null;
- }
+ public static EdgePropertyEnum getByProperty(String property) {
+ for (EdgePropertyEnum inst : EdgePropertyEnum.values()) {
+ if (inst.getProperty().equals(property)) {
+ return inst;
+ }
+ }
+ return null;
+ }
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnum.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnum.java
index 485531aa52..ac0ceeb09b 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnum.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnum.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,8 +22,8 @@ package org.openecomp.sdc.be.dao.jsongraph.types;
public enum JsonParseFlagEnum {
- NoParse,
- ParseAll,
- ParseJson,
- ParseMetadata
+ NoParse,
+ ParseAll,
+ ParseJson,
+ ParseMetadata
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java
index 053a690858..01d3ac493d 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnum.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,66 +20,57 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
import org.openecomp.sdc.be.datatypes.elements.*;
import org.openecomp.sdc.be.resources.data.DataTypeData;
-
+@Getter
+@AllArgsConstructor
public enum VertexTypeEnum {
NODE_TYPE ("node_type", null),
- TOPOLOGY_TEMPLATE ("topology_template", CompositionDataDefinition.class),
+ TOPOLOGY_TEMPLATE ("topology_template", CompositionDataDefinition.class),
ARTIFACTS ("artifacts", ArtifactDataDefinition.class),
- TOSCA_ARTIFACTS ("tosca_artifacts", ArtifactDataDefinition.class),
- DEPLOYMENT_ARTIFACTS ("deployment_artifacts", ArtifactDataDefinition.class),
+ TOSCA_ARTIFACTS ("tosca_artifacts", ArtifactDataDefinition.class),
+ DEPLOYMENT_ARTIFACTS ("deployment_artifacts", ArtifactDataDefinition.class),
INST_DEPLOYMENT_ARTIFACTS ("inst_deployment_artifacts", MapArtifactDataDefinition.class),
- INTERFACE_ARTIFACTS ("interface_artifacts", InterfaceDataDefinition.class),
- INSTANCE_ARTIFACTS ("instance_artifacts", MapArtifactDataDefinition.class),
- PROPERTIES ("properties", PropertyDataDefinition.class),
+ INTERFACE_ARTIFACTS ("interface_artifacts", InterfaceDataDefinition.class),
+ INSTANCE_ARTIFACTS ("instance_artifacts", MapArtifactDataDefinition.class),
+ PROPERTIES ("properties", PropertyDataDefinition.class),
CAPABILITIES ("capabilities", ListCapabilityDataDefinition.class),
- CAPABILITIES_PROPERTIES ("capabilities_properties", MapPropertiesDataDefinition.class),
+ CAPABILITIES_PROPERTIES ("capabilities_properties", MapPropertiesDataDefinition.class),
REQUIREMENTS ("requirements", ListRequirementDataDefinition.class),
- ATTRIBUTES ("attributes", PropertyDataDefinition.class),
- RESOURCE_CATEGORY ("resourceNewCategory", null),
- RESOURCE_SUBCATEGORY ("resourceSubcategory", null),
- SERVICE_CATEGORY ("serviceNewCategory", null),
- ADDITIONAL_INFORMATION ("additional_information", AdditionalInfoParameterDataDefinition.class),
+ ATTRIBUTES ("attributes", PropertyDataDefinition.class),
+ RESOURCE_CATEGORY ("resourceNewCategory", null),
+ RESOURCE_SUBCATEGORY ("resourceSubcategory", null),
+ SERVICE_CATEGORY ("serviceNewCategory", null),
+ ADDITIONAL_INFORMATION ("additional_information", AdditionalInfoParameterDataDefinition.class),
USER ("user", null),
- INPUTS ("inputs", PropertyDataDefinition.class),
- GROUPS ("groups", GroupDataDefinition.class),
- INST_ATTRIBUTES ("instAttributes", MapPropertiesDataDefinition.class),
- INST_PROPERTIES ("instProperties", MapPropertiesDataDefinition.class),
- INST_INPUTS ("instInputs", MapPropertiesDataDefinition.class),
- INST_GROUPS ("instGroups", MapGroupsDataDefinition.class),
- SERVICE_API_ARTIFACTS ("serviceApiArtifacts", ArtifactDataDefinition.class),
- CALCULATED_CAPABILITIES ("calculatedCapabilities", MapListCapabilityDataDefinition.class),
- FULLFILLED_CAPABILITIES ("fullfilledCapabilities", MapListCapabilityDataDefinition.class),
- CALCULATED_REQUIREMENTS ("calculatedRequirements", MapListRequirementDataDefinition.class),
- FULLFILLED_REQUIREMENTS ("fullfilledRequirements", MapListRequirementDataDefinition.class),
- CALCULATED_CAP_PROPERTIES ("calculatedCapProperties", MapCapabilityProperty.class),
- FORWARDING_PATH ("path", ForwardingPathDataDefinition.class),
+ INPUTS ("inputs", PropertyDataDefinition.class),
+ GROUPS ("groups", GroupDataDefinition.class),
+ INST_ATTRIBUTES ("instAttributes", MapPropertiesDataDefinition.class),
+ INST_PROPERTIES ("instProperties", MapPropertiesDataDefinition.class),
+ INST_INPUTS ("instInputs", MapPropertiesDataDefinition.class),
+ INST_GROUPS ("instGroups", MapGroupsDataDefinition.class),
+ SERVICE_API_ARTIFACTS ("serviceApiArtifacts", ArtifactDataDefinition.class),
+ CALCULATED_CAPABILITIES ("calculatedCapabilities", MapListCapabilityDataDefinition.class),
+ FULLFILLED_CAPABILITIES ("fullfilledCapabilities", MapListCapabilityDataDefinition.class),
+ CALCULATED_REQUIREMENTS ("calculatedRequirements", MapListRequirementDataDefinition.class),
+ FULLFILLED_REQUIREMENTS ("fullfilledRequirements", MapListRequirementDataDefinition.class),
+ CALCULATED_CAP_PROPERTIES ("calculatedCapProperties", MapCapabilityProperty.class),
+ FORWARDING_PATH ("path", ForwardingPathDataDefinition.class),
POLICIES ("policies", PolicyDataDefinition.class),
- EXTERNAL_REF ("componentInstanceExtRefs", MapComponentInstanceExternalRefs.class),
- CATALOG_ROOT ("catalogRoot", null),
- ARCHIVE_ROOT ("archiveRoot", null),
+ EXTERNAL_REF ("componentInstanceExtRefs", MapComponentInstanceExternalRefs.class),
+ CATALOG_ROOT ("catalogRoot", null),
+ ARCHIVE_ROOT ("archiveRoot", null),
INTERFACE ("interface", InterfaceDataDefinition.class),
- INTERFACE_OPERATION ("interfaceOperation", OperationDataDefinition.class),
- NODE_FILTER_TEMPLATE ("NodeTemplateFilter", CINodeFilterDataDefinition.class),
- INST_INTERFACES ("InstInterfaces", MapInterfaceDataDefinition.class),
- DATA_TYPES ("data_types", DataTypeDataDefinition.class);
+ INTERFACE_OPERATION ("interfaceOperation", OperationDataDefinition.class),
+ NODE_FILTER_TEMPLATE ("NodeTemplateFilter", CINodeFilterDataDefinition.class),
+ INST_INTERFACES ("InstInterfaces", MapInterfaceDataDefinition.class),
+ DATA_TYPES ("data_types", DataTypeDataDefinition.class);
- private String name;
- private Class classOfJson;
- VertexTypeEnum(String name, Class clazz){
- this.name = name;
- classOfJson = clazz;
- }
-
- public String getName() {
- return name;
- }
-
- public Class getClassOfJson() {
- return classOfJson;
- }
+ private final String name;
+ private final Class classOfJson;
public static VertexTypeEnum getByName(String name){
for ( VertexTypeEnum inst : VertexTypeEnum.values() ){
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java
deleted file mode 100644
index e0fd178478..0000000000
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.be.dao;
-
-import org.junit.Test;
-
-public class AccountTest {
-
- private Account createTestSubject() {
- return new Account();
- }
-
- @Test
- public void testCtor() throws Exception {
- new Account("mock", "mock");
- }
-
- @Test
- public void testGetName() throws Exception {
- Account testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getName();
- }
-
- @Test
- public void testSetName() throws Exception {
- Account testSubject;
- String name = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setName(name);
- }
-
- @Test
- public void testGetEmail() throws Exception {
- Account testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getEmail();
- }
-
- @Test
- public void testSetEmail() throws Exception {
- Account testSubject;
- String email = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setEmail(email);
- }
-
- @Test
- public void testEquals() throws Exception {
- Account testSubject;
- Object other = null;
- boolean result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.equals(other);
- result = testSubject.equals(testSubject);
- result = testSubject.equals(createTestSubject());
- }
-
- @Test
- public void testHashCode() throws Exception {
- Account testSubject;
- int result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.hashCode();
- }
-}
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategyTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategyTest.java
new file mode 100644
index 0000000000..450801eb00
--- /dev/null
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/DAOJanusGraphStrategyTest.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2020, Nordix Foundation. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.sdc.be.dao;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.sdc.be.config.ConfigurationManager;
+import org.openecomp.sdc.common.impl.ExternalConfiguration;
+import org.openecomp.sdc.common.impl.FSConfigurationSource;
+
+public class DAOJanusGraphStrategyTest {
+
+ @Before
+ public void setUp() throws Exception {
+ new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(),
+ "src/test/resources/config/catalog-dao"));
+ }
+
+ private DAOJanusGraphStrategy createTestSubject() {
+ return new DAOJanusGraphStrategy();
+ }
+
+ @Test
+ public void getConfigFile() {
+ DAOJanusGraphStrategy testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ assertThat(testSubject.getConfigFile()).isNotNull();
+ }
+}
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java
index 39bf138592..3d7f392b50 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,33 +20,42 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
+import static org.assertj.core.api.Assertions.assertThat;
+
import org.junit.Test;
public class EdgeLabelEnumTest {
- private EdgeLabelEnum createTestSubject() {
- return EdgeLabelEnum.ARTIFACTS;
- }
+ private EdgeLabelEnum createTestSubject() {
+ return EdgeLabelEnum.ARTIFACTS;
+ }
-
- @Test
- public void testGetEdgeLabelEnum() throws Exception {
- String name = "";
- EdgeLabelEnum result;
+ @Test
+ public void testGetEdgeLabelEnum() throws Exception {
+ String name = "";
+ EdgeLabelEnum result;
- // default test
- result = EdgeLabelEnum.getEdgeLabelEnum(name);
+ // default test
+ result = EdgeLabelEnum.getEdgeLabelEnum(name);
+ assertThat(result).isNull();
}
-
- @Test
- public void testIsInstanceArtifactsLabel() throws Exception {
- EdgeLabelEnum testSubject;
- boolean result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.isInstanceArtifactsLabel();
- }
+ @Test
+ public void testEnumValues() {
+ for (final Object value : EdgeLabelEnum.values()) {
+ assertThat(value).isNotNull().isInstanceOf(EdgeLabelEnum.class);
+ }
+ }
+
+ @Test
+ public void testIsInstanceArtifactsLabel() throws Exception {
+ EdgeLabelEnum testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isInstanceArtifactsLabel();
+ assertThat(result).isFalse();
+ }
}
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java
index 2b517d1c57..066b8ec37e 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,33 +20,26 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
-import org.junit.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.Test;
public class EdgePropertyEnumTest {
- private EdgePropertyEnum createTestSubject() {
- return EdgePropertyEnum.STATE;
- }
-
-
- @Test
- public void testGetProperty() throws Exception {
- EdgePropertyEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getProperty();
- }
-
-
- @Test
- public void testGetByProperty() throws Exception {
- String property = "";
- EdgePropertyEnum result;
-
- // default test
- result = EdgePropertyEnum.getByProperty(property);
- }
+ @Test
+ public void testEnumValues() {
+ for (final Object value : EdgePropertyEnum.values()) {
+ assertThat(value).isNotNull().isInstanceOf(EdgePropertyEnum.class);
+ }
+ }
+
+ @Test
+ public void testGetByProperty() throws Exception {
+ String property = "";
+ EdgePropertyEnum result;
+
+ // default test
+ result = EdgePropertyEnum.getByProperty(property);
+ assertThat(result).isNull();
+ }
}
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/GraphJsonProperty.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnumTest.java
index c9120bbcf7..c95d1cb46e 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/types/GraphJsonProperty.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/JsonParseFlagEnumTest.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* SDC
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020, Nordix Foundation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,23 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdc.be.dao.jsongraph.types;
-import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
-public enum GraphJsonProperty {
- METADATA (GraphPropertyEnum.METADATA),
- JSON (GraphPropertyEnum.JSON);
-
- private GraphPropertyEnum propInGraph;
-
- GraphJsonProperty (GraphPropertyEnum propInGraph){
- this.propInGraph = propInGraph;
- }
+public class JsonParseFlagEnumTest {
- public GraphPropertyEnum getPropInGraph() {
- return propInGraph;
- }
-
+ @Test
+ public void testEnumValues() {
+ for (final Object value : JsonParseFlagEnum.values()) {
+ assertThat(value).isNotNull().isInstanceOf(JsonParseFlagEnum.class);
+ }
+ }
}
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java
index 0efe7021a9..ab0e9540cd 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,44 +20,30 @@
package org.openecomp.sdc.be.dao.jsongraph.types;
-import org.junit.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.Test;
public class VertexTypeEnumTest {
- private VertexTypeEnum createTestSubject() {
- return VertexTypeEnum.ADDITIONAL_INFORMATION;
- }
-
-
- @Test
- public void testGetName() throws Exception {
- VertexTypeEnum testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getName();
- }
-
-
- @Test
- public void testGetClassOfJson() throws Exception {
- VertexTypeEnum testSubject;
- Class result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getClassOfJson();
- }
-
-
- @Test
- public void testGetByName() throws Exception {
- String name = "";
- VertexTypeEnum result;
-
- // default test
- result = VertexTypeEnum.getByName(name);
- }
+ private VertexTypeEnum createTestSubject() {
+ return VertexTypeEnum.ADDITIONAL_INFORMATION;
+ }
+
+ @Test
+ public void testEnumValues() {
+ for (final Object value : VertexTypeEnum.values()) {
+ assertThat(value).isNotNull().isInstanceOf(VertexTypeEnum.class);
+ }
+ }
+
+ @Test
+ public void testGetByName() throws Exception {
+ String name = "";
+ VertexTypeEnum result;
+
+ // default test
+ result = VertexTypeEnum.getByName(name);
+ assertThat(result).isNull();
+ }
}