From 8b19c01ef6a1a074106fe6077bfde07f48248f1d Mon Sep 17 00:00:00 2001 From: vasraz Date: Wed, 20 May 2020 10:04:51 +0100 Subject: Fix wrong tests directory structure Change-Id: I0538e5ad56c9a77a0e9cb40d629739e979b67495 Issue-ID: SDC-3073 Signed-off-by: Vasyl Razinkov --- .../ElementToEntitlementPoolConvertorTest.java | 64 ------------------- .../ElementToFeatureGroupConvertorTest.java | 65 ------------------- .../ElementToLicenseAgreementConvertorTest.java | 70 -------------------- .../ElementToLicenseKeyGroupConvertorTest.java | 74 ---------------------- .../convertor/ElementToLimitConvertorTest.java | 52 --------------- .../ElementToVLMGeneralConvertorTest.java | 60 ------------------ .../ElementToEntitlementPoolConvertorTest.java | 64 +++++++++++++++++++ .../ElementToFeatureGroupConvertorTest.java | 65 +++++++++++++++++++ .../ElementToLicenseAgreementConvertorTest.java | 70 ++++++++++++++++++++ .../ElementToLicenseKeyGroupConvertorTest.java | 74 ++++++++++++++++++++++ .../convertor/ElementToLimitConvertorTest.java | 52 +++++++++++++++ .../ElementToVLMGeneralConvertorTest.java | 60 ++++++++++++++++++ 12 files changed, 385 insertions(+), 385 deletions(-) delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java (limited to 'openecomp-be/lib') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java deleted file mode 100644 index ebac7b1b12..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.Id; -import com.amdocs.zusammen.datatypes.item.Info; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; - -public class ElementToEntitlementPoolConvertorTest { - - private static final String ENTITY_ID = "entityId1"; - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - - private ElementToEntitlementPoolConvertor converter = new ElementToEntitlementPoolConvertor(); - - - @Test - public void shouldConvertElementToEntitlementPoolEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - elementToConvert.setElementId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - EntitlementPoolEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID, result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - } - - @Test - public void shouldConvertElementInfoToEntitlementPoolEntity(){ - ElementInfo elementToConvert = new ElementInfo(); - elementToConvert.setId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - EntitlementPoolEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID, result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - } - - private Info createInfo() { - Info info = new Info(); - info.setName(ENTITY_NAME); - info.setDescription(ENTITY_DESCRIPTION); - return info; - } -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java deleted file mode 100644 index 49624a5c55..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.Id; -import com.amdocs.zusammen.datatypes.item.Info; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; - -public class ElementToFeatureGroupConvertorTest { - - private static final String ENTITY_ID = "entityId1"; - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - - - private ElementToFeatureGroupConvertor converter = new ElementToFeatureGroupConvertor(); - - @Test - public void shouldConvertElementToFeatureGroupEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - elementToConvert.setElementId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - FeatureGroupEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID, result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - } - - @Test - public void shouldConvertElementInfoToFeatureGroupEntity(){ - ElementInfo elementToConvert = new ElementInfo(); - elementToConvert.setId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - FeatureGroupEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID, result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - } - - private Info createInfo() { - Info info = new Info(); - info.setName(ENTITY_NAME); - info.setDescription(ENTITY_DESCRIPTION); - return info; - } -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java deleted file mode 100644 index 33cfe366c1..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.Id; -import com.amdocs.zusammen.datatypes.item.Info; -import java.util.HashMap; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; - -public class ElementToLicenseAgreementConvertorTest { - private static final String ENTITY_ID = "entityId1"; - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - private static final String LICENSE_TERM = "Fixed_Term"; - - private ElementToLicenseAgreementConvertor converter = new ElementToLicenseAgreementConvertor(); - - @Test - public void shouldConvertElementToLicenseAgreementEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - elementToConvert.setElementId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - LicenseAgreementEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID, result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - assertEquals(LICENSE_TERM, result.getLicenseTerm().getChoice().name()); - } - - @Test - public void shouldConvertElementInfoToLicenseAgreementEntity(){ - ElementInfo elementToConvert = new ElementInfo(); - elementToConvert.setId(new Id(ENTITY_ID)); - elementToConvert.setInfo(createInfo()); - LicenseAgreementEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID,result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - assertEquals(LICENSE_TERM, result.getLicenseTerm().getChoice().name()); - } - - private Info createInfo(){ - Info info = new Info(); - info.setName(ENTITY_NAME); - info.setDescription(ENTITY_DESCRIPTION); - HashMap choiceOrOther = new HashMap<>(); - choiceOrOther.put("choice", LICENSE_TERM); - choiceOrOther.put("other", "other"); - info.addProperty("licenseTerm", choiceOrOther); - return info; - } -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java deleted file mode 100644 index da1a492eee..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ - -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.Id; -import com.amdocs.zusammen.datatypes.item.Info; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; - -public class ElementToLicenseKeyGroupConvertorTest { - - private static final String ENTITY_ID = "entityId1"; - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - private static final String LICENSE_KEY_TYPE = "Unique"; - - private ElementToLicenseKeyGroupConvertor converter = new ElementToLicenseKeyGroupConvertor(); - - @Test - public void shouldConvertElementToLicenseKeyGroupEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - elementToConvert.setElementId(new Id(ENTITY_ID)); - Info info = createInfo(); - elementToConvert.setInfo(info); - LicenseKeyGroupEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID,result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - assertEquals(LICENSE_KEY_TYPE, result.getType().name()); - - } - - - @Test - public void shouldConvertElementInfoToLicenseKeyGroupEntity() { - ElementInfo elementToConvert = new ElementInfo(); - elementToConvert.setId(new Id(ENTITY_ID)); - Info info = createInfo(); - elementToConvert.setInfo(info); - LicenseKeyGroupEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID,result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - assertEquals(LICENSE_KEY_TYPE, result.getType().name()); - - } - - private Info createInfo() { - Info info = new Info(); - info.setName(ENTITY_NAME); - info.setDescription(ENTITY_DESCRIPTION); - info.addProperty("LicenseKeyType",LICENSE_KEY_TYPE); - return info; - } - -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java deleted file mode 100644 index 431093eb2d..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ - -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.Id; -import com.amdocs.zusammen.datatypes.item.Info; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; - -public class ElementToLimitConvertorTest { - - private static final String ENTITY_ID = "entityId1"; - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - private static final String LIMIT_TYPE = "ServiceProvider"; - - private ElementToLimitConvertor converter = new ElementToLimitConvertor(); - - @Test - public void shouldConvertElementToLimitEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - elementToConvert.setElementId(new Id(ENTITY_ID)); - Info info = new Info(); - info.setName(ENTITY_NAME); - info.setDescription(ENTITY_DESCRIPTION); - info.addProperty("type",LIMIT_TYPE); - elementToConvert.setInfo(info); - LimitEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_ID,result.getId()); - assertEquals(ENTITY_NAME, result.getName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - assertEquals(LIMIT_TYPE, result.getType().name()); - } - -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java deleted file mode 100644 index 45660a6854..0000000000 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ -package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; - -import static org.junit.Assert.assertEquals; - -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; -import com.amdocs.zusammen.datatypes.item.Info; -import org.junit.Test; -import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; - -public class ElementToVLMGeneralConvertorTest { - - private static final String ENTITY_NAME = "entityTestName"; - private static final String ENTITY_DESCRIPTION = "entityTestDesc"; - - private ElementToVLMGeneralConvertor converter = new ElementToVLMGeneralConvertor(); - - @Test - public void shouldConvertElementToVendorLicenseModelEntity() { - ZusammenElement elementToConvert = new ZusammenElement(); - Info info = new Info(); - info.addProperty("name",ENTITY_NAME); - info.addProperty("description",ENTITY_DESCRIPTION); - elementToConvert.setInfo(info); - VendorLicenseModelEntity result = converter.convert(elementToConvert); - assertEquals(ENTITY_NAME, result.getVendorName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - - - } - - @Test - public void shouldConvertElementInfoToVendorLicenseModelEntity() { - ElementInfo elementInfo = new ElementInfo(); - Info info = new Info(); - info.addProperty("name",ENTITY_NAME); - info.addProperty("description",ENTITY_DESCRIPTION); - elementInfo.setInfo(info); - VendorLicenseModelEntity result = converter.convert(elementInfo); - assertEquals(ENTITY_NAME, result.getVendorName()); - assertEquals(ENTITY_DESCRIPTION, result.getDescription()); - } - - -} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java new file mode 100644 index 0000000000..ebac7b1b12 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertorTest.java @@ -0,0 +1,64 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.Id; +import com.amdocs.zusammen.datatypes.item.Info; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; + +public class ElementToEntitlementPoolConvertorTest { + + private static final String ENTITY_ID = "entityId1"; + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + + private ElementToEntitlementPoolConvertor converter = new ElementToEntitlementPoolConvertor(); + + + @Test + public void shouldConvertElementToEntitlementPoolEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + elementToConvert.setElementId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + EntitlementPoolEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID, result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + } + + @Test + public void shouldConvertElementInfoToEntitlementPoolEntity(){ + ElementInfo elementToConvert = new ElementInfo(); + elementToConvert.setId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + EntitlementPoolEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID, result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + } + + private Info createInfo() { + Info info = new Info(); + info.setName(ENTITY_NAME); + info.setDescription(ENTITY_DESCRIPTION); + return info; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java new file mode 100644 index 0000000000..49624a5c55 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertorTest.java @@ -0,0 +1,65 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.Id; +import com.amdocs.zusammen.datatypes.item.Info; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; + +public class ElementToFeatureGroupConvertorTest { + + private static final String ENTITY_ID = "entityId1"; + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + + + private ElementToFeatureGroupConvertor converter = new ElementToFeatureGroupConvertor(); + + @Test + public void shouldConvertElementToFeatureGroupEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + elementToConvert.setElementId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + FeatureGroupEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID, result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + } + + @Test + public void shouldConvertElementInfoToFeatureGroupEntity(){ + ElementInfo elementToConvert = new ElementInfo(); + elementToConvert.setId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + FeatureGroupEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID, result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + } + + private Info createInfo() { + Info info = new Info(); + info.setName(ENTITY_NAME); + info.setDescription(ENTITY_DESCRIPTION); + return info; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java new file mode 100644 index 0000000000..33cfe366c1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertorTest.java @@ -0,0 +1,70 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.Id; +import com.amdocs.zusammen.datatypes.item.Info; +import java.util.HashMap; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; + +public class ElementToLicenseAgreementConvertorTest { + private static final String ENTITY_ID = "entityId1"; + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + private static final String LICENSE_TERM = "Fixed_Term"; + + private ElementToLicenseAgreementConvertor converter = new ElementToLicenseAgreementConvertor(); + + @Test + public void shouldConvertElementToLicenseAgreementEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + elementToConvert.setElementId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + LicenseAgreementEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID, result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + assertEquals(LICENSE_TERM, result.getLicenseTerm().getChoice().name()); + } + + @Test + public void shouldConvertElementInfoToLicenseAgreementEntity(){ + ElementInfo elementToConvert = new ElementInfo(); + elementToConvert.setId(new Id(ENTITY_ID)); + elementToConvert.setInfo(createInfo()); + LicenseAgreementEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID,result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + assertEquals(LICENSE_TERM, result.getLicenseTerm().getChoice().name()); + } + + private Info createInfo(){ + Info info = new Info(); + info.setName(ENTITY_NAME); + info.setDescription(ENTITY_DESCRIPTION); + HashMap choiceOrOther = new HashMap<>(); + choiceOrOther.put("choice", LICENSE_TERM); + choiceOrOther.put("other", "other"); + info.addProperty("licenseTerm", choiceOrOther); + return info; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java new file mode 100644 index 0000000000..da1a492eee --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertorTest.java @@ -0,0 +1,74 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ + +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.Id; +import com.amdocs.zusammen.datatypes.item.Info; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; + +public class ElementToLicenseKeyGroupConvertorTest { + + private static final String ENTITY_ID = "entityId1"; + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + private static final String LICENSE_KEY_TYPE = "Unique"; + + private ElementToLicenseKeyGroupConvertor converter = new ElementToLicenseKeyGroupConvertor(); + + @Test + public void shouldConvertElementToLicenseKeyGroupEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + elementToConvert.setElementId(new Id(ENTITY_ID)); + Info info = createInfo(); + elementToConvert.setInfo(info); + LicenseKeyGroupEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID,result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + assertEquals(LICENSE_KEY_TYPE, result.getType().name()); + + } + + + @Test + public void shouldConvertElementInfoToLicenseKeyGroupEntity() { + ElementInfo elementToConvert = new ElementInfo(); + elementToConvert.setId(new Id(ENTITY_ID)); + Info info = createInfo(); + elementToConvert.setInfo(info); + LicenseKeyGroupEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID,result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + assertEquals(LICENSE_KEY_TYPE, result.getType().name()); + + } + + private Info createInfo() { + Info info = new Info(); + info.setName(ENTITY_NAME); + info.setDescription(ENTITY_DESCRIPTION); + info.addProperty("LicenseKeyType",LICENSE_KEY_TYPE); + return info; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java new file mode 100644 index 0000000000..431093eb2d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertorTest.java @@ -0,0 +1,52 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ + +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.Id; +import com.amdocs.zusammen.datatypes.item.Info; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; + +public class ElementToLimitConvertorTest { + + private static final String ENTITY_ID = "entityId1"; + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + private static final String LIMIT_TYPE = "ServiceProvider"; + + private ElementToLimitConvertor converter = new ElementToLimitConvertor(); + + @Test + public void shouldConvertElementToLimitEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + elementToConvert.setElementId(new Id(ENTITY_ID)); + Info info = new Info(); + info.setName(ENTITY_NAME); + info.setDescription(ENTITY_DESCRIPTION); + info.addProperty("type",LIMIT_TYPE); + elementToConvert.setInfo(info); + LimitEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_ID,result.getId()); + assertEquals(ENTITY_NAME, result.getName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + assertEquals(LIMIT_TYPE, result.getType().name()); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java new file mode 100644 index 0000000000..45660a6854 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/test/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertorTest.java @@ -0,0 +1,60 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor; + +import static org.junit.Assert.assertEquals; + +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; +import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; +import com.amdocs.zusammen.datatypes.item.Info; +import org.junit.Test; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; + +public class ElementToVLMGeneralConvertorTest { + + private static final String ENTITY_NAME = "entityTestName"; + private static final String ENTITY_DESCRIPTION = "entityTestDesc"; + + private ElementToVLMGeneralConvertor converter = new ElementToVLMGeneralConvertor(); + + @Test + public void shouldConvertElementToVendorLicenseModelEntity() { + ZusammenElement elementToConvert = new ZusammenElement(); + Info info = new Info(); + info.addProperty("name",ENTITY_NAME); + info.addProperty("description",ENTITY_DESCRIPTION); + elementToConvert.setInfo(info); + VendorLicenseModelEntity result = converter.convert(elementToConvert); + assertEquals(ENTITY_NAME, result.getVendorName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + + + } + + @Test + public void shouldConvertElementInfoToVendorLicenseModelEntity() { + ElementInfo elementInfo = new ElementInfo(); + Info info = new Info(); + info.addProperty("name",ENTITY_NAME); + info.addProperty("description",ENTITY_DESCRIPTION); + elementInfo.setInfo(info); + VendorLicenseModelEntity result = converter.convert(elementInfo); + assertEquals(ENTITY_NAME, result.getVendorName()); + assertEquals(ENTITY_DESCRIPTION, result.getDescription()); + } + + +} -- cgit 1.2.3-korg