diff options
author | 2020-04-02 19:03:21 +0200 | |
---|---|---|
committer | 2020-04-07 14:44:56 +0000 | |
commit | e69b87493fb84ef585d02b03d02ec8cc1f819381 (patch) | |
tree | 078316c8ec6f33e7632848ffbab75f785e7329c3 /openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main | |
parent | d1b56d9b7382b8ca53a4006e93c6f35aaae611c0 (diff) |
More unit tests added
Unused constant removed.
Error logging added.
Change-Id: I91dca825e54ffd8f11a69344d6bb00b4e70dbea1
Issue-ID: SDC-2869
Signed-off-by: Dmitry Puzikov <d.puzikov2@partner.samsung.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java index 410b7d2f8f..5fe48ff7ca 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.versioning.impl; import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.versioning.VersionCalculator; import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.dao.types.VersionStatus; @@ -29,20 +31,12 @@ import java.util.HashSet; import java.util.Set; public class VersionCalculatorImpl implements VersionCalculator { + private static final Logger LOGGER = LoggerFactory.getLogger(VersionCalculatorImpl.class); private static final String INITIAL_VERSION = "1.0"; private static final String VERSION_STRING_VIOLATION_MSG = "Version string must be in the format of: {integer}.{integer}"; - private static final String PARENT_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_TOP_LEVEL = - "Creation of parent level version on top level version is invalid."; - private static final String SUB_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_LOWEST_LEVEL = - "Creation of parent level version on top level version is invalid."; - - private static final String VERSION_CALCULATION_ERROR_MSG = - "Version calculation error."; - - private static final String INVALID_CREATION_METHOD_MSG = "Invalid creation method-"; - + private static final String INVALID_CREATION_METHOD_MSG = "Invalid creation method"; @Override public String calculate(String baseVersion, VersionCreationMethod creationMethod) { @@ -85,12 +79,10 @@ public class VersionCalculatorImpl implements VersionCalculator { optionalCreationMethods.add(versionCreationMethod); } } catch (IllegalArgumentException iae) { - //not a valid creation method. + LOGGER.error("{}:{}", INVALID_CREATION_METHOD_MSG, versionCreationMethod.name(), iae); } } } version.getAdditionalInfo().put("OptionalCreationMethods", optionalCreationMethods); - } - } |