diff options
author | Dunietz, Irwin <id1681@att.com> | 2020-01-16 15:13:14 -0500 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2020-01-29 19:44:48 +0000 |
commit | b5fe8a69e90b950c07dc11af481eab7e9bab52c6 (patch) | |
tree | 3da81ce60554e65b93776b9aea647f3c6d8679ab /appc-dispatcher/appc-license-manager/appc-license-manager-core | |
parent | 9b32cb60360a2a2973c621053510718de0072111 (diff) |
Change code in appc dispatcher for new LCMs in R6
Also introduce some minor improvements to robustness, efficiency, & formatting.
Issue-ID: APPC-1789
Signed-off-by: Dunietz, Irwin <id1681@att.com>
Change-Id: I82d970c2f7cde6c8dab1222af86ea70ce93b7e50
Diffstat (limited to 'appc-dispatcher/appc-license-manager/appc-license-manager-core')
3 files changed, 19 insertions, 15 deletions
diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/LicenseManagerImplTest.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/LicenseManagerImplTest.java index 9d2fb87b4..ad924ca0a 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/LicenseManagerImplTest.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/LicenseManagerImplTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Modifications Copyright (C) 2018 Nokia * ================================================================================ + * Modifications Copyright (C) 2019 AT&T Intellectual Property + * ================================================================================ * 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 @@ -61,15 +63,15 @@ public class LicenseManagerImplTest { public void retrieveLicenseModel_shouldThrowException_whenRetrieveLicenseModelDataIsEmpty() { // GIVEN - String expectedMessage = String - .format("License model not found for vnfType='%s' and vnfVersion='%s'", VNF_TYPE, VNF_VERSION); + String expectedMessage = + String.format("License model not found for vnfType='%s' and vnfVersion='%s'", VNF_TYPE, VNF_VERSION); given(licenseDataAccessService.retrieveLicenseModelData(VNF_TYPE, VNF_VERSION)) - .willReturn(Collections.emptyMap()); + .willReturn(Collections.emptyMap()); // WHEN THEN assertThatExceptionOfType(DataAccessException.class) - .isThrownBy(() -> licenseManager.retrieveLicenseModel(VNF_TYPE, VNF_VERSION)) - .withMessage(expectedMessage); + .isThrownBy(() -> licenseManager.retrieveLicenseModel(VNF_TYPE, VNF_VERSION)) + .withMessage(expectedMessage); } @Test @@ -81,11 +83,11 @@ public class LicenseManagerImplTest { Map<String, String> licenseModelData = new HashMap<>(); licenseModelData.put(ARTIFACT_CONTENT.name(), malformedXml); given(licenseDataAccessService.retrieveLicenseModelData(VNF_TYPE, VNF_VERSION)) - .willReturn(licenseModelData); + .willReturn(licenseModelData); // WHEN THEN assertThatExceptionOfType(DataAccessException.class) - .isThrownBy(() -> licenseManager.retrieveLicenseModel(VNF_TYPE, VNF_VERSION)); + .isThrownBy(() -> licenseManager.retrieveLicenseModel(VNF_TYPE, VNF_VERSION)); } @Test @@ -102,7 +104,7 @@ public class LicenseManagerImplTest { Map<String, String> licenseModelData = new HashMap<>(); licenseModelData.put(ARTIFACT_CONTENT.name(), correctlyFormedXml); given(licenseDataAccessService.retrieveLicenseModelData(VNF_TYPE, VNF_VERSION)) - .willReturn(licenseModelData); + .willReturn(licenseModelData); // WHEN LicenseModel licenseModel = licenseManager.retrieveLicenseModel(VNF_TYPE, VNF_VERSION); @@ -111,4 +113,4 @@ public class LicenseManagerImplTest { assertEquals(expectedEntitlementPool, licenseModel.getEntitlementPoolUuid()); assertEquals(expectedKeyGroup, licenseModel.getLicenseKeyGroupUuid()); } -}
\ No newline at end of file +} diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/XmlToLicenseModelConverterTest.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/XmlToLicenseModelConverterTest.java index d0c48cc93..2dd3fde51 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/XmlToLicenseModelConverterTest.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/onap/appc/licmgr/impl/XmlToLicenseModelConverterTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2018 Nokia * ============================================================================= + * Modifications Copyright (C) 2019 AT&T Intellectual Property + * ================================================================================ * 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 @@ -57,7 +59,7 @@ public class XmlToLicenseModelConverterTest { // WHEN converter.convert((a, b) -> { - }, anyString(), null); + }, anyString(), null); // THEN then(xmlStreamReader).should().close(); @@ -72,9 +74,9 @@ public class XmlToLicenseModelConverterTest { // WHEN THEN assertThatExceptionOfType(XMLStreamException.class) - .isThrownBy(() -> converter.convert((a, b) -> { - throw new XMLStreamException(); - }, anyString(), null)); + .isThrownBy(() -> converter.convert((a, b) -> { + throw new XMLStreamException(); + }, anyString(), null)); then(xmlStreamReader).should().close(); } -}
\ No newline at end of file +} diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/resources/test-vf-license-model.xml b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/resources/test-vf-license-model.xml index 6f32f50b8..9f0b2b6ed 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/resources/test-vf-license-model.xml +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/resources/test-vf-license-model.xml @@ -60,4 +60,4 @@ </license-key-group-list> </feature-group> </feature-group-list> -</vf-license-model>
\ No newline at end of file +</vf-license-model> |