From 9f8477bc49755f9b1e417266624bbc04958e8b9b Mon Sep 17 00:00:00 2001 From: vasraz Date: Tue, 24 Mar 2020 17:32:06 +0000 Subject: Increase test coverage Change-Id: Ie28e36012be1313efa0082b34c0b36c325dc1b76 Signed-off-by: Vasyl Razinkov Issue-ID: SDC-2833 --- .../openecomp/sdc/be/model/ConsumerDefinition.java | 6 +- .../sdc/be/model/ImplementationArtifact.java | 67 ---------------------- .../sdc/be/model/ConsumerDefinitionTest.java | 18 ++++-- 3 files changed, 15 insertions(+), 76 deletions(-) delete mode 100644 catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java (limited to 'catalog-model/src') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ConsumerDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ConsumerDefinition.java index 18e4098794..7fde867578 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ConsumerDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ConsumerDefinition.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. @@ -25,11 +25,9 @@ import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition; public class ConsumerDefinition extends ConsumerDataDefinition { public ConsumerDefinition() { - super(); } public ConsumerDefinition(ConsumerDataDefinition a) { super(a); - } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java deleted file mode 100644 index 77bc91663e..0000000000 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ImplementationArtifact.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 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.model; - -/** - * Specifies an implementation artifact for interfaces or operations of a - * {@link NodeType node type} or {@link RelationshipType relation type}. - * - * @author esofer - */ -public class ImplementationArtifact { - /** - *

- * Specifies the type of this artifact. - *

- */ - private String artifactType; - - /** - *

- * Identifies an Artifact Template to be used as implementation artifact. - * This Artifact Template can be defined in the same Definitions document or - * in a separate, imported document. - *

- * - *

- * The type of Artifact Template referenced by the artifactRef attribute - * MUST be the same type or a sub-type of the type specified in the - * artifactType attribute. - *

- * - *

- * Note: if no Artifact Template is referenced, the artifact type specific - * content of the ImplementationArtifact element alone is assumed to - * represent the actual artifact. For example, a simple script could be - * defined in place within the ImplementationArtifact element. - *

- */ - private String artifactRef; - - /** - * The name of the archive in which the artifact lies. - */ - private String archiveName; - /** - * The version of the archive in which the artifact lies. - */ - private String archiveVersion; -} diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ConsumerDefinitionTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ConsumerDefinitionTest.java index 86ed903df6..c3967ae86e 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/ConsumerDefinitionTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/ConsumerDefinitionTest.java @@ -16,19 +16,27 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * Modifications Copyright (C) 2020, Nordix Foundation. */ + package org.openecomp.sdc.be.model; -import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding; -import static org.junit.Assert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition; public class ConsumerDefinitionTest { + + @Test + public void testCtor() { + final ConsumerDefinition testSubject = new ConsumerDefinition(); + assertThat(testSubject).isNotNull().isInstanceOf(ConsumerDefinition.class); + } + @Test - public void shouldHaveValidGettersAndSetters() { - assertThat(ConsumerDataDefinition.class, - hasValidGettersAndSettersExcluding("empty", "ownerIdIfEmpty", "type", "version")); + public void testConsumerDataDefinition_clone() { + final ConsumerDefinition testSubject = new ConsumerDefinition(new ConsumerDataDefinition()); + assertThat(testSubject).isNotNull().isInstanceOf(ConsumerDefinition.class); } } \ No newline at end of file -- cgit 1.2.3-korg