diff options
author | vasraz <vasyl.razinkov@est.tech> | 2020-03-24 12:29:04 +0000 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-03-26 06:42:01 +0000 |
commit | 29ef7edbf694dea1a33a7ddd97b7250d2ec1f61e (patch) | |
tree | 23f04a3efc5e733ad5e283c897b864c5e746f6f5 /catalog-be/src | |
parent | bca8dd9ac181bde35c9f89766e86855d9ddd2102 (diff) |
Increase test coverage
Change-Id: I90606d768c55ad13aa9df62bc4d3f533206db1bc
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-2833
Diffstat (limited to 'catalog-be/src')
3 files changed, 6 insertions, 7 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java index d29f23eef8..ebd3e21d9d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/lifecycle/LifecycleBusinessLogic.java @@ -469,7 +469,7 @@ public class LifecycleBusinessLogic { throw new ByResponseFormatComponentException(componentUtils.getResponseFormatByResource(componentUtils.convertFromStorageResponse(status), resource)); } result = ModelConverter.convertFromToscaElement(certifyResourceRes.left().value()); - resource.setMetadataDefinition(result.getComponentMetadataDefinition()); + resource.setComponentMetadataDefinition(result.getComponentMetadataDefinition()); } finally { log.info("unlock component {}", resource.getUniqueId()); if (!inTransaction) { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java index 4408b3c1ce..84efb81ad0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java @@ -43,7 +43,6 @@ import java.util.Set; import mockit.Deencapsulation; import org.apache.commons.lang3.tuple.ImmutablePair; import org.assertj.core.util.Lists; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -1183,7 +1182,7 @@ public class ComponentInstanceBusinessLogicTest { service.setLastUpdaterUserId(oldServiceLastUpdatedUserId); resource.setLifecycleState(oldResourceLifeCycle); - assertThat(result.isLeft()); + assertThat(result.isLeft()).isFalse(); } @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java index 13bc009d32..f54b85f492 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsConverterTest.java @@ -92,7 +92,7 @@ public class InterfacesOperationsConverterTest { public void addInterfaceTypeElementToResource() { Component component = new Resource(); component.setNormalizedName("normalizedComponentName"); - component.setMetadataDefinition(new ServiceMetadataDefinition()); + component.setComponentMetadataDefinition(new ServiceMetadataDefinition()); component.getComponentMetadataDefinition().getMetadataDataDefinition().setName("NodeTypeName"); component.getComponentMetadataDefinition().getMetadataDataDefinition().setSystemName("NodeTypeName"); InterfaceDefinition addedInterface = new InterfaceDefinition(); @@ -118,7 +118,7 @@ public class InterfacesOperationsConverterTest { public void addInterfaceTypeElementToService() { Component component = new Service(); component.setNormalizedName("normalizedServiceComponentName"); - component.setMetadataDefinition(new ServiceMetadataDefinition()); + component.setComponentMetadataDefinition(new ServiceMetadataDefinition()); component.getComponentMetadataDefinition().getMetadataDataDefinition().setName("NodeTypeName"); component.getComponentMetadataDefinition().getMetadataDataDefinition().setSystemName("NodeTypeName"); InterfaceDefinition addedInterface = new InterfaceDefinition(); @@ -523,7 +523,7 @@ public class InterfacesOperationsConverterTest { @Test public void testAddInterfaceTypeElementGetCorrectLocalInterfaceName() { Service service = new Service(); - service.setMetadataDefinition(new ServiceMetadataDefinition()); + service.setComponentMetadataDefinition(new ServiceMetadataDefinition()); service.getComponentMetadataDefinition().getMetadataDataDefinition().setName("LocalInterface"); service.getComponentMetadataDefinition().getMetadataDataDefinition().setSystemName("LocalInterface"); service.setInterfaces(Collections.singletonMap("Local", new InterfaceDefinition("Local", null, new HashMap<>()))); @@ -538,7 +538,7 @@ public class InterfacesOperationsConverterTest { @Test public void testAddInterfaceTypeElementNoTypeChangeIfNotLocal() { Service service = new Service(); - service.setMetadataDefinition(new ServiceMetadataDefinition()); + service.setComponentMetadataDefinition(new ServiceMetadataDefinition()); service.getComponentMetadataDefinition().getMetadataDataDefinition().setName("LocalInterface"); service.setInterfaces(Collections.singletonMap("NotLocal", new InterfaceDefinition("NotLocal", null, new HashMap<>()))); |