diff --git a/appc-common/pom.xml b/appc-common/pom.xml
index 72348bf..4f228bc 100644
--- a/appc-common/pom.xml
+++ b/appc-common/pom.xml
@@ -96,6 +96,18 @@
           <groupId>org.onap.ccsdk.sli.core</groupId>
           <artifactId>dblib-provider</artifactId>
       </dependency>
+      <dependency>
+          <groupId>org.powermock</groupId>
+          <artifactId>powermock-reflect</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.powermock</groupId>
+          <artifactId>powermock-module-junit4</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.powermock</groupId>
+          <artifactId>powermock-api-mockito</artifactId>
+      </dependency>
 
   </dependencies>
 
diff --git a/appc-common/src/main/java/org/openecomp/appc/Constants.java b/appc-common/src/main/java/org/openecomp/appc/Constants.java
index c5315ed..5e59971 100644
--- a/appc-common/src/main/java/org/openecomp/appc/Constants.java
+++ b/appc-common/src/main/java/org/openecomp/appc/Constants.java
@@ -168,10 +168,10 @@
     @SuppressWarnings("nls")
     public static final String STATUS_GETTER = "status-getter";
 
-	@SuppressWarnings("nls")
+    @SuppressWarnings("nls")
     public static final String VM_FUSION_STATUS_GETTER = "fusion-vm-status-getter";
 
-	/**
+    /**
      * The name for the status vm attribute to be set in the context when executing a vmstatuscheck.
      */
 
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategies.java b/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategies.java
index 7f63e00..196b645 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategies.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategies.java
@@ -24,7 +24,9 @@
 
 package org.openecomp.appc.cache;
 
-
+/**
+ * Enum of CacheStrategies
+ */
 public enum CacheStrategies {
-    LRU;
+    LRU
 }
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategy.java b/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategy.java
index aa0a5d7..e077081 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategy.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/CacheStrategy.java
@@ -24,8 +24,23 @@
 
 package org.openecomp.appc.cache;
 
-
-public interface CacheStrategy <K,V>{
+/**
+ * Interface of CacheStrategy
+ * @param <K> key
+ * @param <V> value
+ */
+public interface CacheStrategy <K,V> {
+    /**
+     * Get object
+     * @param key of the object
+     * @return value of the object
+     */
     V getObject(K key);
+
+    /**
+     * Put object
+     * @param key of the object
+     * @param value of the object
+     */
     void putObject(K key,V value);
 }
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/MetadataCache.java b/appc-common/src/main/java/org/openecomp/appc/cache/MetadataCache.java
index d5b1d7b..8196e8e 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/MetadataCache.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/MetadataCache.java
@@ -24,8 +24,23 @@
 
 package org.openecomp.appc.cache;
 
-
-public interface MetadataCache <K,V>{
+/**
+ * Interface of MetadataCache
+ * @param <K> key
+ * @param <V> value
+ */
+public interface MetadataCache <K,V> {
+    /**
+     * Get object
+     * @param key of the object
+     * @return value of the object
+     */
     V getObject(K key);
+
+    /**
+     * Put object
+     * @param key of the object
+     * @param value of the object
+     */
     void putObject(K key,V value);
 }
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/impl/LRUCache.java b/appc-common/src/main/java/org/openecomp/appc/cache/impl/LRUCache.java
index 5cb8ef5..b97a5f6 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/impl/LRUCache.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/impl/LRUCache.java
@@ -29,12 +29,17 @@
 
 import org.openecomp.appc.cache.CacheStrategy;
 
+/**
+ * LRU cache implements CacheStategy<K, V>
+ * @param <K> Key
+ * @param <V> Value
+ */
 public class LRUCache<K,V> implements CacheStrategy<K,V> {
 
     private Map<K,V> map;
 
     LRUCache(final Integer capacity){
-        map = new LinkedHashMap<K,V>(capacity, 0.75F, true){
+        map = new LinkedHashMap<K,V>(capacity, 0.75F, true) {
             @Override
             protected boolean removeEldestEntry(Map.Entry<K, V> eldest){
                 return size() > capacity;
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheFactory.java b/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheFactory.java
index 306a23a..91ad48f 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheFactory.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheFactory.java
@@ -25,16 +25,23 @@
 package org.openecomp.appc.cache.impl;
 
 import org.openecomp.appc.cache.CacheStrategies;
-import org.openecomp.appc.cache.CacheStrategy;
 import org.openecomp.appc.cache.MetadataCache;
 
+/**
+ * Metadata Cache Factory
+ */
 public class MetadataCacheFactory {
 
-    private static class ReferenceHolder{
+    private static class ReferenceHolder {
+        private ReferenceHolder() {
+            throw new IllegalAccessError("ReferenceHolder");
+        }
+
         private static final MetadataCacheFactory FACTORY = new MetadataCacheFactory();
     }
-    private MetadataCacheFactory(){
 
+    private MetadataCacheFactory() {
+        // do nothing
     }
 
     public static MetadataCacheFactory getInstance(){
@@ -44,7 +51,13 @@
     public MetadataCache getMetadataCache(){
         return new MetadataCacheImpl();
     }
-    public MetadataCache getMetadataCache(CacheStrategies cacheStrategy){
+
+    /**
+     * Get MetadataCache
+     * @param cacheStrategy the CacheStrategies to be used to build MetadataCacheImpl
+     * @return a new instance of MetadataCacheImpl
+     */
+    public MetadataCache getMetadataCache(CacheStrategies cacheStrategy) {
         return new MetadataCacheImpl(cacheStrategy);
     }
 
diff --git a/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheImpl.java b/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheImpl.java
index 9661006..249a97c 100644
--- a/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheImpl.java
+++ b/appc-common/src/main/java/org/openecomp/appc/cache/impl/MetadataCacheImpl.java
@@ -28,7 +28,11 @@
 import org.openecomp.appc.cache.CacheStrategy;
 import org.openecomp.appc.cache.MetadataCache;
 
-
+/**
+ * Implementation of MetadataCache
+ * @param <K> Key
+ * @param <V> Value
+ */
 public class MetadataCacheImpl<K,V> implements MetadataCache<K,V> {
 
     private CacheStrategy strategy;
@@ -42,9 +46,13 @@
     }
 
     private CacheStrategy initializeStrategy(CacheStrategies strategy) {
-        switch (strategy){
-            case LRU:
-                return new LRUCache<>(50);
+        if (strategy != null) {
+            switch (strategy) {
+                case LRU:
+                    return new LRUCache<>(50);
+                default:
+                    // do nothing
+            }
         }
         return null;
     }
diff --git a/appc-common/src/main/java/org/openecomp/appc/configuration/DefaultConfiguration.java b/appc-common/src/main/java/org/openecomp/appc/configuration/DefaultConfiguration.java
index 96d9be8..6353849 100644
--- a/appc-common/src/main/java/org/openecomp/appc/configuration/DefaultConfiguration.java
+++ b/appc-common/src/main/java/org/openecomp/appc/configuration/DefaultConfiguration.java
@@ -24,7 +24,6 @@
 
 package org.openecomp.appc.configuration;
 
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -64,7 +63,7 @@
     /**
      * Construct the configuration object.
      */
-    public DefaultConfiguration() {
+    DefaultConfiguration() {
         // do nothing
     }
 
@@ -97,22 +96,20 @@
      */
     @SuppressWarnings("nls")
     private static String decrypt(String value) {
-        if (value != null) {
-            if (value.startsWith(EncryptionTool.ENCRYPTED_VALUE_PREFIX)) {
-                try {
-                    return EncryptionTool.getInstance().decrypt(value);
-                } catch (Exception e) {
-                    StringBuilder out = new StringBuilder();
-                    for (Provider p : Security.getProviders()) {
-                        for (Service s : p.getServices()) {
-                            String algo = s.getAlgorithm();
-                            out.append(String.format("\n==Found Algorithm [ %s ] in provider [ %s ] and service [ %s ]",
-                                    algo, p.getName(), s.getClassName()));
-                        }
+        if (value != null && value.startsWith(EncryptionTool.ENCRYPTED_VALUE_PREFIX)) {
+            try {
+                return EncryptionTool.getInstance().decrypt(value);
+            } catch (Exception e) {
+                StringBuilder out = new StringBuilder();
+                for (Provider p : Security.getProviders()) {
+                    for (Service s : p.getServices()) {
+                        String algo = s.getAlgorithm();
+                        out.append(String.format("\n==Found Algorithm [ %s ] in provider [ %s ] and service [ %s ]",
+                                algo, p.getName(), s.getClassName()));
                     }
-                    logger.debug(out.toString());
-                    logger.warn(String.format("Could not decrypt the configuration value [%s]", value), e);
                 }
+                logger.debug(out.toString());
+                logger.warn(String.format("Could not decrypt the configuration value [%s]", value), e);
             }
         }
         return value;
@@ -172,9 +169,9 @@
         // template = decrypt(template); DH: Do not assign values to parameters, bad form! Also, Sonar complains
         // bitterly
 
-        StringBuffer buffer = new StringBuffer(decrypt(template));
+        StringBuilder builder = new StringBuilder(decrypt(template));
         Pattern pattern = Pattern.compile("\\$\\{([^\\}]+)\\}");
-        Matcher matcher = pattern.matcher(buffer);
+        Matcher matcher = pattern.matcher(builder);
         while (matcher.find()) {
             String variable = matcher.group(1);
             String value = properties.getProperty(variable);
@@ -184,11 +181,11 @@
             if (value == null) {
                 value = "";
             }
-            buffer.replace(matcher.start(), matcher.end(), value);
+            builder.replace(matcher.start(), matcher.end(), value);
 
             matcher.reset();
         }
-        return buffer.toString().trim();
+        return builder.toString().trim();
     }
 
     /**
@@ -379,7 +376,7 @@
      */
     @Override
     public int hashCode() {
-        return (properties == null ? 0 : properties.hashCode());
+        return properties == null ? 0 : properties.hashCode();
     }
 
     /**
@@ -487,7 +484,7 @@
         try {
             properties.load(is);
         } catch (IOException e) {
-            e.printStackTrace();
+            logger.warn("setProperties with inputStream got exception", e);
         }
     }
 
@@ -524,8 +521,8 @@
     @SuppressWarnings("nls")
     @Override
     public String toString() {
-        return String.format("Configuration: %d properties, keys:[%s]", properties.size(), properties.keySet()
-                .toString());
+        return String.format("Configuration: %d properties, keys:[%s]",
+                properties.size(), properties.keySet().toString());
     }
 
     /**
diff --git a/appc-common/src/main/java/org/openecomp/appc/exceptions/APPCException.java b/appc-common/src/main/java/org/openecomp/appc/exceptions/APPCException.java
index 808434d..314d0a6 100644
--- a/appc-common/src/main/java/org/openecomp/appc/exceptions/APPCException.java
+++ b/appc-common/src/main/java/org/openecomp/appc/exceptions/APPCException.java
@@ -22,8 +22,6 @@
  * ============LICENSE_END=========================================================
  */
 
-
-
 package org.openecomp.appc.exceptions;
 
 /**
diff --git a/appc-common/src/main/java/org/openecomp/appc/exceptions/UnknownProviderException.java b/appc-common/src/main/java/org/openecomp/appc/exceptions/UnknownProviderException.java
index 1551f48..f3eb8a4 100644
--- a/appc-common/src/main/java/org/openecomp/appc/exceptions/UnknownProviderException.java
+++ b/appc-common/src/main/java/org/openecomp/appc/exceptions/UnknownProviderException.java
@@ -22,8 +22,6 @@
  * ============LICENSE_END=========================================================
  */
 
-
-
 package org.openecomp.appc.exceptions;
 
 /**
@@ -100,7 +98,10 @@
     * @param writableStackTrace
     *            whether or not the stack trace should be writable
     */
-   public UnknownProviderException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+   public UnknownProviderException(String message,
+                                   Throwable cause,
+                                   boolean enableSuppression,
+                                   boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
 
diff --git a/appc-common/src/main/java/org/openecomp/appc/logging/LoggingConstants.java b/appc-common/src/main/java/org/openecomp/appc/logging/LoggingConstants.java
index 9d6a32f..5c6d7b2 100644
--- a/appc-common/src/main/java/org/openecomp/appc/logging/LoggingConstants.java
+++ b/appc-common/src/main/java/org/openecomp/appc/logging/LoggingConstants.java
@@ -24,9 +24,21 @@
 
 package org.openecomp.appc.logging;
 
+/**
+ * Constant definition of logging
+ */
 public class LoggingConstants {
+    private LoggingConstants() {
+        throw new IllegalAccessError("LoggingConstants");
+    }
 
+    /**
+     * Constants of MDC property keys
+     */
     public static class MDCKeys {
+        private MDCKeys() {
+            throw new IllegalAccessError("MDCKeys");
+        }
 
         public static final String ERROR_CODE = "ErrorCode";
         public static final String ERROR_DESCRIPTION = "ErrorDescription";
@@ -44,12 +56,24 @@
         public static final String TARGET_VIRTUAL_ENTITY = "TargetVirtualEntity";
     }
 
+    /**
+     * Constants of status code values
+     */
     public static class StatusCodes {
+        private StatusCodes() {
+            throw new IllegalAccessError("StatusCodes");
+        }
         public static final String COMPLETE = "COMPLETE";
         public static final String ERROR = "ERROR";
     }
 
+    /**
+     * Constants of APPC target names
+     */
     public static class TargetNames {
+        private TargetNames() {
+            throw new IllegalAccessError("TargetNames");
+        }
         public static final String APPC = "APPC";
         public static final String AAI = "A&AI";
         public static final String DB = "DataBase";
@@ -62,9 +86,21 @@
         public static final String REQUEST_HANDLER = "RequestHandler";
     }
 
-    public static class TargetServiceNames{
+    /**
+     * Constants of targeted service names
+     */
+    public static class TargetServiceNames {
+        private TargetServiceNames() {
+            throw new IllegalAccessError("TargetServiceNames");
+        }
 
-        public static class AAIServiceNames{
+        /**
+         * Constants of AAI service names
+         */
+        public static class AAIServiceNames {
+            private AAIServiceNames() {
+                throw new IllegalAccessError("AAIServiceNames");
+            }
             public static final String QUERY = "query";
             public static final String GET_VNF_DATA = "getVnfData";
         }
diff --git a/appc-common/src/main/java/org/openecomp/appc/logging/LoggingUtils.java b/appc-common/src/main/java/org/openecomp/appc/logging/LoggingUtils.java
index 70c7fb1..65ea789 100644
--- a/appc-common/src/main/java/org/openecomp/appc/logging/LoggingUtils.java
+++ b/appc-common/src/main/java/org/openecomp/appc/logging/LoggingUtils.java
@@ -41,33 +41,43 @@
 import java.util.Date;
 import java.util.TimeZone;
 
-
-
+/**
+ * Logging utilities
+ */
 public class LoggingUtils {
 
     private final static EELFLogger errorLogger = EELFManager.getInstance().getErrorLogger();
     private final static EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
     private final static EELFLogger metricLogger = EELFManager.getInstance().getMetricsLogger();
 
-    public static void logErrorMessage(String errorCode, String errorDescription, String targetEntity, String targetServiceName, String additionalMessage, String className) {
+    private LoggingUtils() {
+        throw new IllegalAccessError("LoggingUtils");
+    }
+
+    public static void logErrorMessage(String errorCode, String errorDescription, String targetEntity,
+                                       String targetServiceName, String additionalMessage, String className) {
         logError(errorCode, errorDescription, targetEntity, targetServiceName, additionalMessage, className);
     }
 
-    public static void logErrorMessage(String targetEntity, String targetServiceName, String additionalMessage, String className) {
+    public static void logErrorMessage(String targetEntity, String targetServiceName, String additionalMessage,
+                                       String className) {
         logError("", "", targetEntity, targetServiceName, additionalMessage, className);
     }
 
     public static void logErrorMessage(String targetServiceName, String additionalMessage, String className) {
-        logError("", "", LoggingConstants.TargetNames.APPC, targetServiceName, additionalMessage, className);
+        logError("", "", LoggingConstants.TargetNames.APPC, targetServiceName,
+                additionalMessage, className);
     }
 
-    private static void logError(String errorCode, String errorDescription, String targetEntity, String targetServiceName, String additionalMessage, String className) {
+    private static void logError(String errorCode, String errorDescription, String targetEntity,
+                                 String targetServiceName, String additionalMessage, String className) {
         populateErrorLogContext(errorCode, errorDescription, targetEntity, targetServiceName, className);
         errorLogger.error(additionalMessage == null ? "" : additionalMessage);
         cleanErrorLogContext();
     }
 
-    public static void logAuditMessage(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className) {
+    public static void logAuditMessage(Instant beginTimeStamp, Instant endTimeStamp, String code,
+                                       String responseDescription, String className) {
         populateAuditLogContext(beginTimeStamp, endTimeStamp, code, responseDescription, className);
         auditLogger.info(EELFResourceManager.format(Msg.APPC_AUDIT_MSG,
                 MDC.get(MDC_SERVICE_NAME),
@@ -80,13 +90,15 @@
         cleanAuditErrorContext();
     }
 
-    public static void auditInfo(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className,EELFResolvableErrorEnum resourceId, String... arguments) {
+    public static void auditInfo(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription,
+                                 String className,EELFResolvableErrorEnum resourceId, String... arguments) {
         populateAuditLogContext(beginTimeStamp, endTimeStamp, code, responseDescription, className);
         auditLogger.info(resourceId,arguments);
         cleanAuditErrorContext();
     }
 
-    public static void auditWarn(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className,EELFResolvableErrorEnum resourceId, String... arguments) {
+    public static void auditWarn(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription,
+                                 String className,EELFResolvableErrorEnum resourceId, String... arguments) {
         populateAuditLogContext(beginTimeStamp, endTimeStamp, code, responseDescription, className);
         auditLogger.warn(resourceId,arguments);
         cleanAuditErrorContext();
@@ -94,8 +106,11 @@
 
 
 
-    public static void logMetricsMessage(Instant beginTimeStamp, Instant endTimeStamp, String targetEntity, String targetServiceName, String statusCode, String responseCode, String responseDescription, String className) {
-        populateMetricLogContext(beginTimeStamp, endTimeStamp, targetEntity, targetServiceName, statusCode, responseCode, responseDescription, className);
+    public static void logMetricsMessage(Instant beginTimeStamp, Instant endTimeStamp, String targetEntity,
+                                         String targetServiceName, String statusCode, String responseCode,
+                                         String responseDescription, String className) {
+        populateMetricLogContext(beginTimeStamp, endTimeStamp, targetEntity, targetServiceName, statusCode,
+                responseCode, responseDescription, className);
         metricLogger.info(EELFResourceManager.format(Msg.APPC_METRIC_MSG,
                 MDC.get(MDC_SERVICE_NAME),
                 MDC.get(LoggingConstants.MDCKeys.TARGET_VIRTUAL_ENTITY),
@@ -108,10 +123,11 @@
         cleanMetricContext();
     }
 
-    private static void populateAuditLogContext(Instant beginTimeStamp, Instant endTimeStamp, String code, String responseDescription, String className) {
+    private static void populateAuditLogContext(Instant beginTimeStamp, Instant endTimeStamp, String code,
+                                                String responseDescription, String className) {
         populateTimeContext(beginTimeStamp, endTimeStamp);
         MDC.put(LoggingConstants.MDCKeys.RESPONSE_CODE, code);
-        MDC.put(LoggingConstants.MDCKeys.STATUS_CODE, code.equals("100") || code.equals("400") ?
+        MDC.put(LoggingConstants.MDCKeys.STATUS_CODE, "100".equals(code) || "400".equals(code) ?
                 LoggingConstants.StatusCodes.COMPLETE :
                 LoggingConstants.StatusCodes.ERROR);
         MDC.put(LoggingConstants.MDCKeys.RESPONSE_DESCRIPTION, responseDescription!=null?responseDescription:"");
@@ -126,7 +142,8 @@
         MDC.remove(LoggingConstants.MDCKeys.CLASS_NAME);
     }
 
-    private static void populateErrorLogContext(String errorCode, String errorDescription, String targetEntity, String targetServiceName, String className) {
+    private static void populateErrorLogContext(String errorCode, String errorDescription, String targetEntity,
+                                                String targetServiceName, String className) {
         populateErrorContext(errorCode, errorDescription);
         populateTargetContext(targetEntity, targetServiceName!=null?targetServiceName:"");
         MDC.put(LoggingConstants.MDCKeys.CLASS_NAME, className!=null?className:"");
@@ -138,7 +155,9 @@
         MDC.remove(LoggingConstants.MDCKeys.CLASS_NAME);
     }
 
-    private static void populateMetricLogContext(Instant beginTimeStamp, Instant endTimeStamp, String targetEntity, String targetServiceName, String statusCode, String responseCode, String responseDescription, String className) {
+    private static void populateMetricLogContext(Instant beginTimeStamp, Instant endTimeStamp, String targetEntity,
+                                                 String targetServiceName, String statusCode, String responseCode,
+                                                 String responseDescription, String className) {
         populateTimeContext(beginTimeStamp, endTimeStamp);
         populateTargetContext(targetEntity, targetServiceName);
         populateResponseContext(statusCode, responseCode, responseDescription);
diff --git a/appc-common/src/main/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifier.java b/appc-common/src/main/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifier.java
index f768233..8b1b587 100644
--- a/appc-common/src/main/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifier.java
+++ b/appc-common/src/main/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifier.java
@@ -24,51 +24,67 @@
 
 package org.openecomp.appc.metadata.objects;
 
-
+/**
+ * Object of identifier for dependency model.
+ * Currently uses VNF type and catalog version
+ */
 public class DependencyModelIdentifier {
+    static final String TO_STRING_FORMAT = "DependencyModelIdentifier : vnfType = %s , catalogVersion = %s";
+    static final int prime = 31;
+
     private String vnfType;
     private String catalogVersion;
 
-    public DependencyModelIdentifier(String vnfType, String catalogVersion){
+    /**
+     * Constructor
+     * @param vnfType String of the VNF type
+     * @param catalogVersion String of the catalog version
+     */
+    public DependencyModelIdentifier(String vnfType, String catalogVersion) {
         this.vnfType = vnfType;
         this.catalogVersion = catalogVersion;
     }
 
-    public int hashCode(){
-        final int prime = 31;
+    @Override
+    public int hashCode() {
         int result = 1;
         result = result * prime + (this.vnfType == null ? 0 :this.vnfType.hashCode());
         result = result * prime + (this.catalogVersion == null ? 0 :this.catalogVersion.hashCode());
         return result;
     }
 
-    public boolean equals(Object obj){
-        if(obj ==null)
+    @Override
+    public boolean equals(Object obj) {
+        if (obj ==null) {
             return false;
-        if(!(obj instanceof DependencyModelIdentifier))
+        }
+        if (!(obj instanceof DependencyModelIdentifier)) {
             return false;
+        }
 
         DependencyModelIdentifier modelIdentifier = (DependencyModelIdentifier)obj;
-        if(this.vnfType == null){
-            if(modelIdentifier.vnfType !=null)
+        if (this.vnfType == null) {
+            if (modelIdentifier.vnfType !=null) {
                 return false;
-        }
-        else if(!this.vnfType.equals(modelIdentifier.vnfType))
+            }
+        } else if (!this.vnfType.equals(modelIdentifier.vnfType)) {
             return false;
+        }
 
-        if(this.catalogVersion == null){
-            if(modelIdentifier.catalogVersion !=null)
+        if (this.catalogVersion == null) {
+            if (modelIdentifier.catalogVersion !=null) {
                 return false;
-        }
-        else if(!this.catalogVersion.equals(modelIdentifier.catalogVersion))
+            }
+        } else if (!this.catalogVersion.equals(modelIdentifier.catalogVersion)) {
             return false;
+        }
 
         return true;
     }
 
     @Override
     public String toString() {
-        return "DependencyModelIdentifier : vnfType = "+vnfType + " , catalogVersion = " +catalogVersion;
+        return String.format(TO_STRING_FORMAT, vnfType, catalogVersion);
     }
 
     public String getVnfType() {
diff --git a/appc-common/src/test/java/org/openecomp/appc/cache/CacheStrategiesTest.java b/appc-common/src/test/java/org/openecomp/appc/cache/CacheStrategiesTest.java
new file mode 100644
index 0000000..c9e0e00
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/cache/CacheStrategiesTest.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.cache;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CacheStrategiesTest {
+    private CacheStrategies cacheStrategies = CacheStrategies.LRU;
+
+    @Test
+    public void testName() throws Exception {
+        Assert.assertEquals("Should have name LRU", "LRU", cacheStrategies.name());
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        Assert.assertEquals("Should return String LRU", "LRU", cacheStrategies.toString());
+    }
+
+    @Test
+    public void testEquals() throws Exception {
+        Assert.assertTrue(cacheStrategies.equals(CacheStrategies.LRU));
+        Assert.assertFalse(cacheStrategies.equals(null));
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/cache/impl/LRUCacheTest.java b/appc-common/src/test/java/org/openecomp/appc/cache/impl/LRUCacheTest.java
new file mode 100644
index 0000000..75be94d
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/cache/impl/LRUCacheTest.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.cache.impl;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.powermock.reflect.Whitebox;
+
+import java.util.Map;
+
+public class LRUCacheTest {
+
+    @Test
+    public void testConstructor() throws Exception {
+        LRUCache cache = new LRUCache(20);
+        Map internalMap = Whitebox.getInternalState(cache, "map");
+        Assert.assertTrue(internalMap != null);
+        Assert.assertTrue(internalMap.size() == 0);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testGetAndPutObject() throws Exception {
+        LRUCache cache = new LRUCache(20);
+
+        String key = "testing key";
+        Assert.assertTrue(cache.getObject(key) == null);
+
+        String value = "testing value";
+        cache.putObject(key, value);
+        Map internalMap = Whitebox.getInternalState(cache, "map");
+        Assert.assertTrue(internalMap.containsKey(key));
+        Assert.assertTrue(internalMap.containsValue(value));
+        Assert.assertTrue(internalMap.size() == 1);
+
+        Assert.assertEquals(value, cache.getObject(key));
+    }
+
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheFactoryTest.java b/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheFactoryTest.java
new file mode 100644
index 0000000..db66586
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheFactoryTest.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.cache.impl;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openecomp.appc.cache.CacheStrategies;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+
+import static org.mockito.Mockito.mock;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({MetadataCacheFactory.class, MetadataCacheImpl.class})
+public class MetadataCacheFactoryTest {
+    @Test
+    public void testConstructor() throws Exception {
+        Whitebox.invokeConstructor(MetadataCacheFactory.class);
+    }
+
+    @Test
+    public void testGetInstance() throws Exception {
+        Assert.assertTrue("Should not return null", MetadataCacheFactory.getInstance() != null);
+        Assert.assertEquals("Should always return the same object",
+                MetadataCacheFactory.getInstance(), MetadataCacheFactory.getInstance());
+    }
+
+    @Test
+    public void testGetMetadataCacheWithNoArgument() throws Exception {
+        MetadataCacheImpl mockImpl = mock(MetadataCacheImpl.class);
+        PowerMockito.whenNew(MetadataCacheImpl.class).withNoArguments().thenReturn(mockImpl);
+        Assert.assertEquals(mockImpl, MetadataCacheFactory.getInstance().getMetadataCache());
+    }
+
+    @Test
+    public void testGetMetadataCacheWithArgument() throws Exception {
+        CacheStrategies cacheStrategies = CacheStrategies.LRU;
+        MetadataCacheImpl mockImpl = mock(MetadataCacheImpl.class);
+        PowerMockito.whenNew(MetadataCacheImpl.class).withArguments(cacheStrategies).thenReturn(mockImpl);
+        Assert.assertEquals(mockImpl, MetadataCacheFactory.getInstance().getMetadataCache(cacheStrategies));
+    }
+
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheImplTest.java b/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheImplTest.java
new file mode 100644
index 0000000..48cc679
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/cache/impl/MetadataCacheImplTest.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.cache.impl;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.appc.cache.CacheStrategies;
+import org.powermock.reflect.Whitebox;
+
+import static org.mockito.Mockito.spy;
+
+public class MetadataCacheImplTest {
+    @Test
+    public void testConstructor() throws Exception {
+        // test without parameter
+        MetadataCacheImpl impl = new MetadataCacheImpl<>();
+        Assert.assertTrue("Should have initialized strategy",
+                Whitebox.getInternalState(impl, "strategy") != null);
+
+        // test with parameter
+        impl = new MetadataCacheImpl<>(CacheStrategies.LRU);
+        Assert.assertTrue("Should have initialized strategy",
+                Whitebox.getInternalState(impl, "strategy") != null);
+
+        impl = new MetadataCacheImpl<>(null);
+        Assert.assertTrue("Should not initialized strategy",
+                Whitebox.getInternalState(impl, "strategy") == null);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testGetAndPutObject() throws Exception {
+        MetadataCacheImpl impl = spy(new MetadataCacheImpl<>());
+
+        String key = "testing key";
+        Assert.assertTrue(impl.getObject(key) == null);
+
+        String value = "testing value";
+        impl.putObject(key, value);
+        Assert.assertEquals(value, impl.getObject(key));
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/configuration/DefaultConfigurationTest.java b/appc-common/src/test/java/org/openecomp/appc/configuration/DefaultConfigurationTest.java
new file mode 100644
index 0000000..53bd9db
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/configuration/DefaultConfigurationTest.java
@@ -0,0 +1,337 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.configuration;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.powermock.reflect.Whitebox;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import static org.mockito.Mockito.mock;
+
+public class DefaultConfigurationTest {
+    private static final String propKey1 = "testKey1";
+    private static final String propKey2 = "testKey2";
+    private static final String propValue1 = "testValue1";
+    private static final String propValue2 = "testValue2";
+
+    private Properties prop = new Properties();
+    private DefaultConfiguration defaultConfiguration;
+
+    @Before
+    public void setUp() throws Exception {
+        prop.setProperty(propKey1, propValue1);
+        prop.setProperty(propKey2, propValue2);
+
+        defaultConfiguration = new DefaultConfiguration();
+    }
+
+    @Test
+    public void testClear() throws Exception {
+        Whitebox.setInternalState(defaultConfiguration, "properties", prop);
+        defaultConfiguration.clear();
+        Properties internalProp = Whitebox.getInternalState(defaultConfiguration, "properties");
+        Assert.assertTrue("internal properties should be cleared", internalProp.isEmpty());
+    }
+
+    @Test
+    public void testClone() throws Exception {
+        Object clonedObject = defaultConfiguration.clone();
+        Assert.assertTrue("Should be DefaultConfiguration", clonedObject instanceof DefaultConfiguration);
+        Properties internalProp = Whitebox.getInternalState(defaultConfiguration, "properties");
+        Properties clonedInternalProp = Whitebox.getInternalState(clonedObject, "properties");
+        Assert.assertEquals(internalProp, clonedInternalProp);
+    }
+
+    @Test
+    public void testEquals() throws Exception {
+        // test compare with null
+        Assert.assertFalse(defaultConfiguration.equals(null));
+        // test with non-DefaultConfiguration object
+        Assert.assertFalse(defaultConfiguration.equals("abc"));
+
+        // test with not match DefaultConfiguration object
+        defaultConfiguration.setProperties(prop);
+        DefaultConfiguration newConfig = new DefaultConfiguration();
+        Assert.assertFalse(defaultConfiguration.equals(newConfig));
+
+        // test with matching DefaultConfiguration object
+        newConfig.setProperties(prop);
+        Assert.assertTrue(defaultConfiguration.equals(newConfig));
+    }
+
+    @Test
+    public void testSetPropAndGetBooleanProperty() throws Exception {
+        String booleanKey = "booleanKey";
+        // test default value
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey));
+        // test match value true
+        defaultConfiguration.setProperty(booleanKey, "true");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey));
+        defaultConfiguration.setProperty(booleanKey, "True");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey));
+        defaultConfiguration.setProperty(booleanKey, "TrUe");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey));
+        // test not matching true values
+        defaultConfiguration.setProperty(booleanKey, "false");
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey));
+        defaultConfiguration.setProperty(booleanKey, "abc");
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey));
+    }
+
+    @Test
+    public void testSetPropAndGetBooleanPropertyWithDefaultValue() throws Exception {
+        String booleanKey = "booleanKey";
+        // test default value
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey, false));
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey, true));
+        // test match value true
+        defaultConfiguration.setProperty(booleanKey, "true");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey, false));
+        defaultConfiguration.setProperty(booleanKey, "True");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey, false));
+        defaultConfiguration.setProperty(booleanKey, "TrUe");
+        Assert.assertTrue(defaultConfiguration.getBooleanProperty(booleanKey, false));
+        // test not matching true values
+        defaultConfiguration.setProperty(booleanKey, "false");
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey, true));
+        defaultConfiguration.setProperty(booleanKey, "abc");
+        Assert.assertFalse(defaultConfiguration.getBooleanProperty(booleanKey, true));
+    }
+
+    @Test
+    public void testSetPropAndGetDoubleProperty() throws Exception {
+        String doubleKey = "doubleKey";
+        // test default value
+        Assert.assertTrue(0.0 == defaultConfiguration.getDoubleProperty(doubleKey));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(doubleKey, "abc");
+        Assert.assertTrue(0.0 == defaultConfiguration.getDoubleProperty(doubleKey));
+        // test normal
+        defaultConfiguration.setProperty(doubleKey, "1.1");
+        Assert.assertTrue(1.1 == defaultConfiguration.getDoubleProperty(doubleKey));
+    }
+
+    @Test
+    public void testSetPropAndGetDoublePropertyWithDefaultValue() throws Exception {
+        String doubleKey = "doubleKey";
+        // test default value
+        Assert.assertTrue(2.2 == defaultConfiguration.getDoubleProperty(doubleKey, 2.2));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(doubleKey, "abc");
+        Assert.assertTrue(0.0 == defaultConfiguration.getDoubleProperty(doubleKey, 2.2));
+        // test normal
+        defaultConfiguration.setProperty(doubleKey, "1.1");
+        Assert.assertTrue(1.1 == defaultConfiguration.getDoubleProperty(doubleKey, 2.2));
+    }
+
+    @Test
+    public void testSetPropAndGetIntegerProperty() throws Exception {
+        String integerKey = "integerKey";
+        // test default value
+        Assert.assertTrue(0 == defaultConfiguration.getIntegerProperty(integerKey));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(integerKey, "abc");
+        Assert.assertTrue(0 == defaultConfiguration.getIntegerProperty(integerKey));
+        // test normal
+        defaultConfiguration.setProperty(integerKey, "100");
+        Assert.assertTrue(100 == defaultConfiguration.getIntegerProperty(integerKey));
+    }
+
+    @Test
+    public void testSetPropAndGetIntegerPropertyWithDefaultValue() throws Exception {
+        String integerKey = "integerKey";
+        // test default value
+        Assert.assertTrue(100 == defaultConfiguration.getIntegerProperty(integerKey, 100));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(integerKey, "abc");
+        Assert.assertTrue(0 == defaultConfiguration.getIntegerProperty(integerKey, 100));
+        // test normal
+        defaultConfiguration.setProperty(integerKey, "100");
+        Assert.assertTrue(100 == defaultConfiguration.getIntegerProperty(integerKey, 10));
+    }
+
+    @Test
+    public void testSetPropAndGetLongProperty() throws Exception {
+        String longKey = "longKey";
+        // test default value
+        Assert.assertTrue(0 == defaultConfiguration.getLongProperty(longKey));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(longKey, "abc");
+        Assert.assertTrue(0 == defaultConfiguration.getLongProperty(longKey));
+        // test normal
+        defaultConfiguration.setProperty(longKey, "100");
+        Assert.assertTrue(100 == defaultConfiguration.getLongProperty(longKey));
+    }
+
+    @Test
+    public void testSetPropAndGetLongPropertyWithDefaultVaue() throws Exception {
+        String longKey = "longKey";
+        // test default value
+        Assert.assertTrue(10 == defaultConfiguration.getLongProperty(longKey, 10));
+        // test NumberFormatException
+        defaultConfiguration.setProperty(longKey, "abc");
+        Assert.assertTrue(0 == defaultConfiguration.getLongProperty(longKey, 10));
+        // test normal
+        defaultConfiguration.setProperty(longKey, "100");
+        Assert.assertTrue(100 == defaultConfiguration.getLongProperty(longKey, 10));
+    }
+
+    @Test
+    public void testSetAndGetProperties() throws Exception {
+        Properties internalProp = Whitebox.getInternalState(defaultConfiguration, "properties");
+        Assert.assertEquals(internalProp, defaultConfiguration.getProperties());
+
+        defaultConfiguration.setProperties(prop);
+        internalProp = Whitebox.getInternalState(defaultConfiguration, "properties");
+        Assert.assertEquals(internalProp, defaultConfiguration.getProperties());
+    }
+
+    @Test
+    public void testSetAndGetProperty() throws Exception {
+        String key = "key";
+        // test default value
+        Assert.assertTrue(null == defaultConfiguration.getProperty(key));
+        // test normal
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertEquals("abc", defaultConfiguration.getProperty(key));
+    }
+
+    @Test
+    public void testSetPropAndGetPropertyWithDefaultValue() throws Exception {
+        String key = "key";
+        // test default value
+        Assert.assertTrue(null == defaultConfiguration.getProperty(key, null));
+        Assert.assertEquals("abc", defaultConfiguration.getProperty(key, "abc"));
+        // test normal
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertEquals("abc", defaultConfiguration.getProperty(key, "abcd"));
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        Properties properties = null;
+        Whitebox.setInternalState(defaultConfiguration, "properties", properties);
+        Assert.assertEquals(0, defaultConfiguration.hashCode());
+
+
+        Whitebox.setInternalState(defaultConfiguration, "properties", prop);
+        Assert.assertEquals(prop.hashCode(), defaultConfiguration.hashCode());
+    }
+
+    @Test
+    public void testIsPropertyDefined() throws Exception {
+        String key = "key";
+        // test not exist
+        Assert.assertFalse(defaultConfiguration.isPropertyDefined(key));
+        // test exist
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertTrue(defaultConfiguration.isPropertyDefined(key));
+    }
+
+    @Test
+    public void testIsValidBoolean() throws Exception {
+        String key = "key";
+        // test not exist
+        Assert.assertFalse(defaultConfiguration.isValidBoolean(key));
+        // test exist with invalid
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertFalse(defaultConfiguration.isValidBoolean(key));
+        // test exist with valid
+        defaultConfiguration.setProperty(key, "True");
+        Assert.assertTrue(defaultConfiguration.isPropertyDefined(key));
+        defaultConfiguration.setProperty(key, "FaLse");
+        Assert.assertTrue(defaultConfiguration.isPropertyDefined(key));
+    }
+
+    @Test
+    public void testIsValidDouble() throws Exception {
+        String key = "key";
+        // test not exist
+        Assert.assertFalse(defaultConfiguration.isValidDouble(key));
+        // test exist with invalid
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertFalse(defaultConfiguration.isValidDouble(key));
+        // test exist with valid
+        defaultConfiguration.setProperty(key, "2");
+        Assert.assertTrue(defaultConfiguration.isValidDouble(key));
+        defaultConfiguration.setProperty(key, "3.45");
+        Assert.assertTrue(defaultConfiguration.isValidDouble(key));
+    }
+
+    @Test
+    public void testIsValidInteger() throws Exception {
+        String key = "key";
+        // test not exist
+        Assert.assertFalse(defaultConfiguration.isValidInteger(key));
+        // test exist with invalid
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertFalse(defaultConfiguration.isValidInteger(key));
+        defaultConfiguration.setProperty(key, "3.45");
+        Assert.assertFalse(defaultConfiguration.isValidInteger(key));
+        // test exist with valid
+        defaultConfiguration.setProperty(key, "2");
+        Assert.assertTrue(defaultConfiguration.isValidInteger(key));
+    }
+
+    @Test
+    public void testIsValidLong() throws Exception {
+        String key = "key";
+        // test not exist
+        Assert.assertFalse(defaultConfiguration.isValidLong(key));
+        // test exist with invalid
+        defaultConfiguration.setProperty(key, "abc");
+        Assert.assertFalse(defaultConfiguration.isValidLong(key));
+        defaultConfiguration.setProperty(key, "3.45");
+        Assert.assertFalse(defaultConfiguration.isValidLong(key));
+        // test exist with valid
+        defaultConfiguration.setProperty(key, "2");
+        Assert.assertTrue(defaultConfiguration.isValidLong(key));
+    }
+
+    @Test
+    public void testSetPropertiesWithInputStream() throws Exception {
+        InputStream mockIS = mock(InputStream.class);
+        defaultConfiguration.setProperties(mockIS);
+
+        Properties mockProp = mock(Properties.class);
+        Mockito.doThrow(new IOException("testing exception")).when(mockProp).load(mockIS);
+        Whitebox.setInternalState(defaultConfiguration, "properties", mockProp);
+        defaultConfiguration.setProperties(mockIS);
+        // Should come here without exception
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        Properties internalProp = Whitebox.getInternalState(defaultConfiguration, "properties");
+        Assert.assertEquals(String.format("Configuration: %d properties, keys:[%s]",
+                internalProp.size(), internalProp.keySet().toString()), defaultConfiguration.toString());
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/exceptions/APPCExceptionTest.java b/appc-common/src/test/java/org/openecomp/appc/exceptions/APPCExceptionTest.java
new file mode 100644
index 0000000..fc6aa9e
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/exceptions/APPCExceptionTest.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.exceptions;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.powermock.reflect.Whitebox;
+
+
+public class APPCExceptionTest {
+
+    @Test
+    public void testConstructorNoArgument() throws Exception {
+        APPCException appcException = new APPCException();
+        Assert.assertTrue(appcException.getCause() == null);
+        Assert.assertTrue(appcException.getLocalizedMessage() == null);
+        Assert.assertTrue(appcException.getMessage() == null);
+    }
+
+    @Test
+    public void testConstructorWithMessaqge() throws Exception {
+        String message = "testing message";
+        APPCException appcException = new APPCException(message);
+        Assert.assertTrue(appcException.getCause() == null);
+        Assert.assertEquals(message, appcException.getLocalizedMessage());
+        Assert.assertEquals(message, appcException.getMessage());
+    }
+
+    @Test
+    public void testConstructorWithThrowable() throws Exception {
+        String message = "testing message";
+        Throwable throwable = new Throwable(message);
+        APPCException appcException = new APPCException(throwable);
+        Assert.assertEquals(throwable, appcException.getCause());
+        Assert.assertTrue(appcException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(appcException.getMessage().contains(message));
+    }
+
+    @Test
+    public void testConstructorWithMessageAndThrowable() throws Exception {
+        String message = "testing message";
+        String tMessage = "throwable message";
+        Throwable throwable = new Throwable(tMessage);
+        APPCException appcException = new APPCException(message, throwable);
+        Assert.assertEquals(throwable, appcException.getCause());
+        Assert.assertTrue(appcException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(appcException.getMessage().contains(message));
+    }
+
+    @Test
+    public void testConstructorWithFourArguments() throws Exception {
+        String message = "testing message";
+        String tMessage = "throwable message";
+        Throwable throwable = new Throwable(tMessage);
+        APPCException appcException = new APPCException(message, throwable, true, true);
+        Assert.assertEquals(throwable, appcException.getCause());
+        Assert.assertTrue(appcException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(appcException.getMessage().contains(message));
+
+        Assert.assertTrue(Whitebox.getInternalState(appcException, "stackTrace") != null);
+        Assert.assertTrue(Whitebox.getInternalState(appcException, "suppressedExceptions") != null);
+
+        appcException = new APPCException(message, throwable, false, false);
+        Assert.assertTrue(Whitebox.getInternalState(appcException, "stackTrace") == null);
+        Assert.assertTrue(Whitebox.getInternalState(appcException, "suppressedExceptions") == null);
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidInputExceptionTest.java b/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidInputExceptionTest.java
new file mode 100644
index 0000000..5608a12
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidInputExceptionTest.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.exceptions;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class InvalidInputExceptionTest {
+    @Test
+    public void testConstructor() throws Exception {
+        String message = "testing message";
+        InvalidInputException invalidInputException = new InvalidInputException(message);
+        Assert.assertTrue(invalidInputException.getCause() == null);
+        Assert.assertEquals(message, invalidInputException.getLocalizedMessage());
+        Assert.assertEquals(message, invalidInputException.getMessage());
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidStateExceptionTest.java b/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidStateExceptionTest.java
new file mode 100644
index 0000000..a095a51
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/exceptions/InvalidStateExceptionTest.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ * 
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.exceptions;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class InvalidStateExceptionTest {
+    @Test
+    public void testConstructor() throws Exception {
+        String message = "testing message";
+        InvalidStateException invalidStateException = new InvalidStateException(message);
+        Assert.assertTrue(invalidStateException.getCause() == null);
+        Assert.assertEquals(message, invalidStateException.getLocalizedMessage());
+        Assert.assertEquals(message, invalidStateException.getMessage());
+    }
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/exceptions/UnknownProviderExceptionTest.java b/appc-common/src/test/java/org/openecomp/appc/exceptions/UnknownProviderExceptionTest.java
new file mode 100644
index 0000000..d3fc15d
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/exceptions/UnknownProviderExceptionTest.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.exceptions;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.powermock.reflect.Whitebox;
+
+public class UnknownProviderExceptionTest {
+
+    @Test
+    public void testConstructorNoArgument() throws Exception {
+        UnknownProviderException unknownProviderException = new UnknownProviderException();
+        Assert.assertTrue(unknownProviderException.getCause() == null);
+        Assert.assertTrue(unknownProviderException.getLocalizedMessage() == null);
+        Assert.assertTrue(unknownProviderException.getMessage() == null);
+    }
+
+    @Test
+    public void testConstructorWithMessaqge() throws Exception {
+        String message = "testing message";
+        UnknownProviderException unknownProviderException = new UnknownProviderException(message);
+        Assert.assertTrue(unknownProviderException.getCause() == null);
+        Assert.assertEquals(message, unknownProviderException.getLocalizedMessage());
+        Assert.assertEquals(message, unknownProviderException.getMessage());
+    }
+
+    @Test
+    public void testConstructorWithThrowable() throws Exception {
+        String message = "testing message";
+        Throwable throwable = new Throwable(message);
+        UnknownProviderException unknownProviderException = new UnknownProviderException(throwable);
+        Assert.assertEquals(throwable, unknownProviderException.getCause());
+        Assert.assertTrue(unknownProviderException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(unknownProviderException.getMessage().contains(message));
+    }
+
+    @Test
+    public void testConstructorWithMessageAndThrowable() throws Exception {
+        String message = "testing message";
+        String tMessage = "throwable message";
+        Throwable throwable = new Throwable(tMessage);
+        UnknownProviderException unknownProviderException = new UnknownProviderException(message, throwable);
+        Assert.assertEquals(throwable, unknownProviderException.getCause());
+        Assert.assertTrue(unknownProviderException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(unknownProviderException.getMessage().contains(message));
+    }
+
+    @Test
+    public void testConstructorWithFourArguements() throws Exception {
+        String message = "testing message";
+        String tMessage = "throwable message";
+        Throwable throwable = new Throwable(tMessage);
+        UnknownProviderException unknownProviderException =
+                new UnknownProviderException(message, throwable, true, true);
+        Assert.assertEquals(throwable, unknownProviderException.getCause());
+        Assert.assertTrue(unknownProviderException.getLocalizedMessage().contains(message));
+        Assert.assertTrue(unknownProviderException.getMessage().contains(message));
+
+        Assert.assertTrue(Whitebox.getInternalState(unknownProviderException, "stackTrace") != null);
+        Assert.assertTrue(Whitebox.getInternalState(unknownProviderException,
+                "suppressedExceptions") != null);
+
+        unknownProviderException = new UnknownProviderException(message, throwable, false, false);
+        Assert.assertTrue(Whitebox.getInternalState(unknownProviderException,
+                "stackTrace") == null);
+        Assert.assertTrue(Whitebox.getInternalState(unknownProviderException,
+                "suppressedExceptions") == null);
+    }
+
+}
diff --git a/appc-common/src/test/java/org/openecomp/appc/i18n/MsgTest.java b/appc-common/src/test/java/org/openecomp/appc/i18n/MsgTest.java
index 24820b8..aa30ae7 100644
--- a/appc-common/src/test/java/org/openecomp/appc/i18n/MsgTest.java
+++ b/appc-common/src/test/java/org/openecomp/appc/i18n/MsgTest.java
@@ -2,12 +2,19 @@
 
 import static org.junit.Assert.assertNotNull;
 
+import org.junit.Assert;
 import org.junit.Test;
 
-
 public class MsgTest {
 
     @Test
+    public void testNameAndToString() throws Exception {
+        for (Msg msg : Msg.values()) {
+            Assert.assertEquals(msg.name(), msg.toString());
+        }
+    }
+
+    @Test
     public void testCONFIGURATION_STARTED() {
         assertNotNull(Msg.valueOf("CONFIGURATION_STARTED"));
     }
@@ -760,5 +767,5 @@
     @Test
     public void testOAM_OPERATION_INVALID_INPUT() {
         assertNotNull(Msg.valueOf("OAM_OPERATION_INVALID_INPUT"));
-    };
+    }
 }
diff --git a/appc-common/src/test/java/org/openecomp/appc/logging/LoggingConstantsTest.java b/appc-common/src/test/java/org/openecomp/appc/logging/LoggingConstantsTest.java
new file mode 100644
index 0000000..547f180
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/logging/LoggingConstantsTest.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.logging;
+
+import org.junit.Test;
+import org.powermock.reflect.Whitebox;
+
+public class LoggingConstantsTest {
+    @Test (expected = IllegalAccessError.class)
+    public void testConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.class);
+    }
+
+    @Test (expected = IllegalAccessError.class)
+    public void testMdcKeysConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.MDCKeys.class);
+    }
+
+    @Test (expected = IllegalAccessError.class)
+    public void testStatusCodesConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.StatusCodes.class);
+    }
+
+    @Test (expected = IllegalAccessError.class)
+    public void testTargetNamesConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.TargetNames.class);
+    }
+
+    @Test (expected = IllegalAccessError.class)
+    public void testTargetServiceNamesConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.TargetServiceNames.class);
+    }
+
+    @Test (expected = IllegalAccessError.class)
+    public void testAAIServiceNamesConstructor() throws Exception {
+        Whitebox.invokeConstructor(LoggingConstants.TargetServiceNames.AAIServiceNames.class);
+    }
+}
\ No newline at end of file
diff --git a/appc-common/src/test/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifierTest.java b/appc-common/src/test/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifierTest.java
new file mode 100644
index 0000000..214943e
--- /dev/null
+++ b/appc-common/src/test/java/org/openecomp/appc/metadata/objects/DependencyModelIdentifierTest.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.metadata.objects;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.powermock.reflect.Whitebox;
+
+import static org.openecomp.appc.metadata.objects.DependencyModelIdentifier.prime;
+
+public class DependencyModelIdentifierTest {
+    private static final String vnfType = "vnfType";
+    private static final String vnfType2 = "vnfType2";
+    private static final String cVersion = "catalogVersion";
+    private DependencyModelIdentifier identifier;
+    private DependencyModelIdentifier identifier1;
+    private DependencyModelIdentifier identifier2;
+    private DependencyModelIdentifier identifier3;
+
+    @Before
+    public void setUp() throws Exception {
+        identifier = new DependencyModelIdentifier(vnfType, cVersion);
+        identifier1 = new DependencyModelIdentifier(null, null);
+        identifier2 = new DependencyModelIdentifier(vnfType, null);
+        identifier3 = new DependencyModelIdentifier(null, cVersion);
+    }
+
+    @Test
+    public void testConstructorAndGetterAndToString() throws Exception {
+        Assert.assertEquals(vnfType, Whitebox.getInternalState(identifier, "vnfType"));
+        Assert.assertEquals(cVersion, Whitebox.getInternalState(identifier, "catalogVersion"));
+
+        Assert.assertEquals(vnfType, identifier.getVnfType());
+        Assert.assertEquals(cVersion, identifier.getCatalogVersion());
+
+        Assert.assertEquals(String.format(DependencyModelIdentifier.TO_STRING_FORMAT, vnfType, cVersion),
+                identifier.toString());
+    }
+
+    @Test
+    public void testHashCode() throws Exception {
+        Assert.assertEquals((prime + vnfType.hashCode()) * prime + cVersion.hashCode(), identifier.hashCode());
+        Assert.assertEquals(prime * prime, identifier1.hashCode());
+        Assert.assertEquals((prime + vnfType.hashCode()) * prime , identifier2.hashCode());
+        Assert.assertEquals(prime* prime + cVersion.hashCode(), identifier3.hashCode());
+    }
+
+    @Test
+    public void testEquals() throws Exception {
+        // other object is null
+        Assert.assertFalse(identifier.equals(null));
+        // other object is wrong data type
+        Assert.assertFalse(identifier.equals("abc"));
+
+        // my vnfType is null
+        Assert.assertFalse(identifier1.equals(identifier));
+        // different vnfType
+        DependencyModelIdentifier identifier4 = new DependencyModelIdentifier(vnfType2, cVersion);
+        Assert.assertFalse(identifier.equals(identifier4));
+        // same vnfType, my catalogVerson is null
+        Assert.assertFalse(identifier2.equals(identifier));
+        // same vnfType and both catalogVersion are null
+        identifier4 = new DependencyModelIdentifier(vnfType, null);
+        Assert.assertTrue(identifier2.equals(identifier4));
+
+        Assert.assertFalse(identifier.equals(identifier1));
+        Assert.assertFalse(identifier.equals(identifier2));
+        Assert.assertFalse(identifier.equals(identifier3));
+
+        Assert.assertFalse(identifier2.equals(identifier1));
+        Assert.assertFalse(identifier2.equals(identifier3));
+
+
+        Assert.assertFalse(identifier3.equals(identifier));
+        Assert.assertFalse(identifier3.equals(identifier1));
+        Assert.assertFalse(identifier3.equals(identifier2));
+
+        identifier4 = new DependencyModelIdentifier(vnfType, cVersion);
+        Assert.assertTrue(identifier.equals(identifier4));
+    }
+
+}
diff --git a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
index bf08680..de22e21 100644
--- a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
+++ b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
@@ -29,6 +29,17 @@
 import org.openecomp.appc.statemachine.objects.State;
 import org.openecomp.appc.statemachine.objects.StateMachineResponse;
 
+/**
+ * Interface of the StateMachine
+ */
 public interface StateMachine {
+    /**
+     * Handle event
+     * @param currentState the current State which the event should be handled from
+     * @param event the Event that needs to be handled
+     * @return StateMachineResponse
+     * @throws InvalidInputException
+     *     when the passed in currentState and event are not predefined or no relevant transition
+     */
     StateMachineResponse handleEvent(State currentState, Event event) throws InvalidInputException;
 }
diff --git a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
index f0cb491..4e21c13 100644
--- a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
+++ b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
@@ -40,8 +40,8 @@
  * Implementation of StateMachine
  */
 public class StateMachineImpl implements StateMachine {
-    private final String invalidInputFormat = "VNF State or incoming event is invalid. State = %s event = %s";
-    final String toStringFormat = "StateMachineImpl{states=%s, events=%s}";
+    private static final String invalidInputFormat = "VNF State or incoming event is invalid. State = %s event = %s";
+    static final String toStringFormat = "StateMachineImpl{states=%s, events=%s}";
 
     private final Set<State> states;
     private final Set<Event> events;
