unit tests for NetconfSessionImpl

Change-Id: Ic1b7d0221343f288b98c41f456809b59689e198f
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/TargetConfig.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/TargetConfig.java
index ecc924c..90f3148 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/TargetConfig.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/TargetConfig.java
@@ -27,21 +27,13 @@
         this.name = name;
     }
 
-    TargetConfig toTargetConfig(String targetConfig) {
-        switch (targetConfig) {
-            case "running":
-                return RUNNING;
-            case "candidate":
-                return CANDIDATE;
-            case "startup":
-                return STARTUP;
-            default:
-                return null;
-        }
+    public static TargetConfig toTargetConfig(String targetConfig) {
+        return valueOf(targetConfig.toUpperCase());
     }
 
     @Override
     public String toString() {
         return this.name;
     }
+
 }