diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceSetupPathCommand.java b/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceSetupPathCommand.java
index 497905f..a14e6e1 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceSetupPathCommand.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceSetupPathCommand.java
@@ -24,9 +24,12 @@
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 
+import org.onlab.util.DataRateUnit;
 import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.net.DeviceId;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
 import org.onosproject.net.intent.Constraint;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
 import org.onosproject.pce.pceservice.LspType;
 import org.onosproject.pce.pceservice.api.PceService;
 
@@ -71,21 +74,33 @@
 
         DeviceId srcDevice = DeviceId.deviceId(src);
         DeviceId dstDevice = DeviceId.deviceId(dst);
-        LspType lspType = LspType.values()[type];
         List<Constraint> listConstrnt = new LinkedList<>();
 
-        // add cost
-        //TODO: need to uncomment below lines once CostConstraint is ready
-        //CostConstraint.Type costType = CostConstraint.Type.values()[cost];
-        //listConstrnt.add(CostConstraint.of(costType));
+        // LSP type validation
+        if ((type < 0) || (type > 2)) {
+           error("The LSP type value can be PCE tunnel with signalling in network (0), " +
+                 "PCE tunnel without signalling in network with segment routing (1), " +
+                 "PCE tunnel without signalling in network (2).");
+           return;
+        }
+        LspType lspType = LspType.values()[type];
 
-        // add bandwidth
+        // Add bandwidth
         // bandwidth default data rate unit is in BPS
         if (bandwidth != 0.0) {
-            //TODO: need to uncomment below line once BandwidthConstraint is ready
-            //listConstrnt.add(LocalBandwidthConstraint.of(bandwidth, DataRateUnit.valueOf("BPS")));
+            listConstrnt.add(BandwidthConstraint.of(bandwidth, DataRateUnit.valueOf("BPS")));
         }
 
+        // Add cost
+        // Cost validation
+        if ((cost < 1) || (cost > 2)) {
+            error("The cost attribute value either IGP cost(1) or TE cost(2).");
+            return;
+        }
+        // Here 'cost - 1' indicates the index of enum
+        CostConstraint.Type costType = CostConstraint.Type.values()[cost - 1];
+        listConstrnt.add(CostConstraint.of(costType));
+
         if (!service.setupPath(srcDevice, dstDevice, name, listConstrnt, lspType)) {
             error("Path creation failed.");
         }
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceUpdatePathCommand.java b/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceUpdatePathCommand.java
index 5ea8686..6ef5fc1 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceUpdatePathCommand.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/cli/PceUpdatePathCommand.java
@@ -24,8 +24,12 @@
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 
+import org.onlab.util.DataRateUnit;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
 import org.onosproject.net.intent.Constraint;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
 import org.onosproject.pce.pceservice.api.PceService;
 
 import org.slf4j.Logger;
@@ -56,23 +60,25 @@
         PceService service = get(PceService.class);
 
         List<Constraint> constrntList = new LinkedList<>();
-        // Assign cost
-        if (cost != 0) {
-            //TODO: need to uncomment below lines once CostConstraint is ready
-            //CostConstraint.Type costType = CostConstraint.Type.values()[Integer.valueOf(cost)];
-            //constrntList.add(CostConstraint.of(costType));
-        }
-
         // Assign bandwidth. Data rate unit is in Bps.
         if (bandwidth != 0.0) {
-            //TODO: need to uncomment below line once BandwidthConstraint is ready
-            //constrntList.add(LocalBandwidthConstraint.of(Double.valueOf(bandwidth), DataRateUnit.valueOf("BPS")));
+            constrntList.add(BandwidthConstraint.of(Double.valueOf(bandwidth), DataRateUnit.valueOf("BPS")));
         }
 
-        //TODO: need to uncomment below lines once updatePath method is added to PceService
-        //if (null == service.updatePath(PcePathId.of(id), constrntList)) {
-        //    error("Path updation failed.");
-        //    return;
-        //}
+        // Assign cost
+        if (cost != 0) {
+            // Cost validation
+            if ((cost < 1) || (cost > 2)) {
+                error("The cost attribute value is either IGP cost(1) or TE cost(2).");
+                return;
+            }
+            CostConstraint.Type costType = CostConstraint.Type.values()[cost - 1];
+            constrntList.add(CostConstraint.of(costType));
+        }
+
+        if (!service.updatePath(TunnelId.valueOf(id), constrntList)) {
+            error("Path updation failed.");
+            return;
+        }
     }
 }
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/DefaultPcePath.java b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/DefaultPcePath.java
index e9d3fec..2724e8a 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/DefaultPcePath.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/DefaultPcePath.java
@@ -20,9 +20,12 @@
 
 import java.util.Objects;
 
+import org.onlab.util.DataRateUnit;
 import org.onosproject.incubator.net.tunnel.Tunnel;
 import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
 import org.onosproject.net.intent.Constraint;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
 
 /**
  * Implementation of an entity which provides functionalities of pce path.
@@ -43,9 +46,10 @@
      * @param id path id
      * @param src ingress
      * @param dst egress
-     * @param lspType lsp type
+     * @param lspType LSP type
      * @param name symbolic-path-name
-     * @param constrnt pce constraint
+     * @param costConstrnt cost constraint
+     * @param bandwidthConstrnt bandwidth constraint
      */
     private DefaultPcePath(TunnelId id, String src, String dst, LspType lspType,
                            String name, Constraint costConstrnt, Constraint bandwidthConstrnt) {
@@ -210,7 +214,7 @@
         @Override
         public Builder lspType(String type) {
             if (null != type) {
-                this.lspType = LspType.values()[Integer.valueOf(type) - 1];
+                this.lspType = LspType.values()[Integer.valueOf(type)];
             }
             return this;
         }
@@ -223,19 +227,14 @@
 
         @Override
         public Builder costConstraint(String cost) {
-            this.costConstraint = null;
-            //TODO: below lines will be uncommented once CostConstraint class is ready
-            //    this.costConstraint = CostConstraint.of(cost);
-            //}
+            this.costConstraint = CostConstraint.of(CostConstraint.Type.values()[Integer.valueOf(cost) - 1]);
             return this;
         }
 
         @Override
         public Builder bandwidthConstraint(String bandwidth) {
-            this.bandwidthConstraint = null;
-            //TODO: below lines will be uncommented once LocalBandwidthConstraint class is ready
-            //    this.bandwidthConstraint = LocalBandwidthConstraint.of(bandwidth);
-            //}
+            this.bandwidthConstraint = BandwidthConstraint.of(Double.valueOf(bandwidth), DataRateUnit
+                    .valueOf("BPS"));
             return this;
         }
 
@@ -244,14 +243,24 @@
             this.id = TunnelId.valueOf(tunnel.tunnelId().id());
             this.source = tunnel.src().toString();
             this.destination = tunnel.dst().toString();
-            //TODO: need to uncomment below line once LSP_SIG_TYPE is added to AnnotationKeys.
-            this.lspType = null; // = LspType.valueOf(tunnel.annotations()
-                                           //.value(AnnotationKeys.LSP_SIG_TYPE));
             this.name = tunnel.tunnelName().toString();
-            //TODO: uncomment below lines once CostConstraint and LocalBandwidthConstraint classes are ready
-            this.costConstraint = null; // = CostConstraint.of(tunnel.path().cost());
-            this.bandwidthConstraint = null; // = LocalBandwidthConstraint.of(tunnel.annotations()
-                                                                        //.value(AnnotationKeys.BANDWIDTH));
+            // LSP type
+            String lspType = tunnel.annotations().value(PcepAnnotationKeys.LSP_SIG_TYPE);
+            if (lspType != null) {
+               this.lspType = LspType.values()[Integer.valueOf(lspType) - 1];
+            }
+            // Cost type
+            String costType = tunnel.annotations().value(PcepAnnotationKeys.COST_TYPE);
+            if (costType != null) {
+                this.costConstraint = CostConstraint.of(CostConstraint.Type.values()[Integer.valueOf(costType) - 1]);
+            }
+            // Bandwidth
+            String bandwidth = tunnel.annotations().value(PcepAnnotationKeys.BANDWIDTH);
+            if (bandwidth != null) {
+                this.bandwidthConstraint = BandwidthConstraint.of(Double.parseDouble(bandwidth),
+                                                                  DataRateUnit.valueOf("BPS"));
+            }
+
             return this;
         }
 
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/DistributedPceStore.java b/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/DistributedPceStore.java
index 9b90da0..f692a62 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/DistributedPceStore.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/DistributedPceStore.java
@@ -34,10 +34,11 @@
 import org.onosproject.incubator.net.tunnel.TunnelId;
 import org.onosproject.incubator.net.resource.label.LabelResource;
 import org.onosproject.incubator.net.resource.label.LabelResourceId;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
 import org.onosproject.net.DeviceId;
-import org.onosproject.net.intent.Constraint;
 import org.onosproject.net.Link;
 import org.onosproject.net.resource.ResourceConsumer;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
 import org.onosproject.pce.pceservice.TunnelConsumerId;
 import org.onosproject.pce.pceservice.LspType;
 import org.onosproject.pce.pcestore.api.LspLocalLabelInfo;
@@ -128,10 +129,9 @@
                         new KryoNamespace.Builder()
                                 .register(KryoNamespaces.API)
                                 .register(PcePathInfo.class,
-                                          //TODO: Instead of Constraint.class need to add actual implemented class
-                                          //TODO: on this interface like CostConstraint.class and
-                                          //TODO: BandwidthConstraint.class. Will be added once it is confirmed.
-                                          Constraint.class,
+                                          CostConstraint.class,
+                                          CostConstraint.Type.class,
+                                          BandwidthConstraint.class,
                                           LspType.class)
                                 .build()))
 
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/PceccTunnelInfo.java b/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/PceccTunnelInfo.java
index 48f49cd..3186d3a 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/PceccTunnelInfo.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/pcestore/PceccTunnelInfo.java
@@ -15,10 +15,10 @@
  */
 package org.onosproject.pce.pcestore;
 
-import java.util.List;
 import com.google.common.base.MoreObjects;
 
 import java.util.Objects;
+import java.util.List;
 
 import org.onosproject.net.resource.ResourceConsumer;
 import org.onosproject.pce.pcestore.api.LspLocalLabelInfo;
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathCodec.java b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathCodec.java
index e0149e7..9be32e3 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathCodec.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathCodec.java
@@ -87,7 +87,7 @@
             jNode = constraintJNode.get(COST);
             if (jNode != null) {
                 String cost = jNode.asText();
-                resultBuilder.bandwidthConstraint(cost);
+                resultBuilder.costConstraint(cost);
             }
 
             // retrieve bandwidth
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
index abd7c88..a54e0b2 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/rest/PcePathWebResource.java
@@ -53,7 +53,6 @@
 /**
  * Query and program pce path.
  */
-
 @Path("path")
 public class PcePathWebResource extends AbstractWebResource {
 
@@ -124,14 +123,11 @@
             LspType lspType = path.lspType();
             List<Constraint> listConstrnt = new LinkedList<Constraint>();
 
-            // add cost
-            //TODO: need to uncomment below lines once Bandwidth and Cost constraint classes are ready
-            //CostConstraint.Type costType = CostConstraint.Type.values()[Integer.valueOf(path.constraint().cost())];
-            //listConstrnt.add(CostConstraint.of(costType));
+            // Add bandwidth
+            listConstrnt.add(path.bandwidthConstraint());
 
-            // add bandwidth. Data rate unit is in BPS.
-            //listConstrnt.add(LocalBandwidthConstraint.of(Double.valueOf(path.constraint().bandwidth()), DataRateUnit
-            //        .valueOf("BPS")));
+            // Add cost
+            listConstrnt.add(path.costConstraint());
 
             Boolean issuccess = nullIsNotFound(get(PceService.class)
                                                .setupPath(srcDevice, dstDevice, path.name(), listConstrnt, lspType),
@@ -161,19 +157,15 @@
             ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
             JsonNode pathNode = jsonTree.get("path");
             PcePath path = codec(PcePath.class).decode((ObjectNode) pathNode, this);
-            // Assign cost
             List<Constraint> constrntList = new LinkedList<Constraint>();
-            //TODO: need to uncomment below lines once CostConstraint class is ready
-            if (path.costConstraint() != null) {
-                //CostConstraint.Type costType = CostConstraint.Type.values()[path.constraint().cost()];
-                //constrntList.add(CostConstraint.of(costType));
+            // Assign bandwidth
+            if (path.bandwidthConstraint() != null) {
+                constrntList.add(path.bandwidthConstraint());
             }
 
-            // Assign bandwidth. Data rate unit is in BPS.
-            if (path.bandwidthConstraint() != null) {
-                //TODO: need to uncomment below lines once BandwidthConstraint class is ready
-                //constrntList.add(LocalBandwidthConstraint
-                //        .of(path.constraint().bandwidth(), DataRateUnit.valueOf("BPS")));
+            // Assign cost
+            if (path.costConstraint() != null) {
+                constrntList.add(path.costConstraint());
             }
 
             Boolean result = nullIsNotFound(get(PceService.class).updatePath(TunnelId.valueOf(id), constrntList),
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/DefaultPcePathTest.java b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/DefaultPcePathTest.java
index 2f5347d..b8134ef 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/DefaultPcePathTest.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/DefaultPcePathTest.java
@@ -21,7 +21,11 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
 
+import com.google.common.testing.EqualsTester;
+
 import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
 
 /**
  * Unit tests for DefaultPcePath class.
@@ -78,8 +82,8 @@
                 .bandwidthConstraint(bandwidth2)
                 .build();
         path2.id(TunnelId.valueOf("2"));
-        //TODO: will be uncommented below line once CostConstraint and LocalBandwidthConstraint classes are ready
-        //new EqualsTester().addEqualityGroup(path1, samePath1).addEqualityGroup(path2).testEquals();
+
+        new EqualsTester().addEqualityGroup(path1, samePath1).addEqualityGroup(path2).testEquals();
     }
 
     /**
@@ -91,7 +95,7 @@
         final String bandwidth = "600";
         final String src = "indiatimes";
         final String dst = "deccan";
-        final String type = "3";
+        final String type = "2";
         final String name = "pcc4";
 
         PcePath path = DefaultPcePath.builder()
@@ -103,12 +107,14 @@
                 .bandwidthConstraint(bandwidth)
                 .build();
 
-        assertThat(src, is(path.source()));
-        assertThat(dst, is(path.destination()));
-        assertThat(LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR, is(path.lspType()));
-        assertThat(name, is(path.name()));
-        //TODO: will be uncommented below lines once CostConstraint and LocalBandwidthConstraint classes are ready
-        //assertThat(cost, is(path.costConstraint().toString()));
-        //assertThat(bandwidth, is(path.bandwidthConstraint().toString()));
+        assertThat(path.source(), is(src));
+        assertThat(path.destination(), is(dst));
+        assertThat(path.lspType(), is(LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR));
+        assertThat(path.name(), is(name));
+        CostConstraint costConstExpected = CostConstraint.of(CostConstraint.Type.values()[Integer.valueOf(cost) - 1]);
+        CostConstraint costConstActual = (CostConstraint) path.costConstraint();
+        assertThat(costConstActual.type(), is(costConstExpected.type()));
+        BandwidthConstraint bandwidthActual = (BandwidthConstraint) path.bandwidthConstraint();
+        assertThat(bandwidthActual.bandwidth().bps(), is(Double.valueOf(bandwidth)));
     }
 }
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/rest/MockPceCodecContext.java b/apps/pce/app/src/test/java/org/onosproject/pce/rest/MockPceCodecContext.java
index 7bced15..f4704de 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/rest/MockPceCodecContext.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/rest/MockPceCodecContext.java
@@ -48,7 +48,6 @@
     @SuppressWarnings("unchecked")
     @Override
     public <T> T getService(Class<T> serviceClass) {
-        // TODO
         return null;
     }
 
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathCodecTest.java b/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathCodecTest.java
index 022058d..9f970d3 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathCodecTest.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathCodecTest.java
@@ -24,8 +24,13 @@
 
 import org.junit.Before;
 import org.junit.Test;
+
+import org.onlab.util.DataRateUnit;
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.pce.pceservice.PcePath;
+import org.onosproject.net.intent.constraint.BandwidthConstraint;
+import org.onosproject.net.intent.Constraint;
+import org.onosproject.pce.pceservice.constraint.CostConstraint;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -80,9 +85,15 @@
 
         assertThat(pcePath.source().toString(), is("11.0.0.1"));
         assertThat(pcePath.destination(), is("11.0.0.2"));
-        assertThat(pcePath.lspType().toString(), is("SR_WITHOUT_SIGNALLING"));
-        //TODO: uncomment below lines once CostConstraint and LocalBandwidthConstraint are ready
-        //assertThat(pcePath.costConstraint().toString(), is(2));
-        //assertThat(pcePath.bandwidthConstraint().toString(), is(200.0));
+        assertThat(pcePath.lspType().toString(), is("WITHOUT_SIGNALLING_AND_WITHOUT_SR"));
+        // testing cost type
+        String cost = "2";
+        Constraint costConstraint = CostConstraint.of(CostConstraint.Type.values()[Integer.valueOf(cost) - 1]);
+        assertThat(pcePath.costConstraint(), is(costConstraint));
+        // testing bandwidth
+        String bandwidth = "200";
+        Constraint bandwidthConstraint = BandwidthConstraint.of(Double.valueOf(bandwidth), DataRateUnit
+                    .valueOf("BPS"));
+        assertThat(pcePath.bandwidthConstraint(), is(bandwidthConstraint));
     }
 }
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathResourceTest.java b/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathResourceTest.java
index d4c79f0..e287c32 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathResourceTest.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/rest/PcePathResourceTest.java
@@ -21,15 +21,14 @@
 import static org.easymock.EasyMock.replay;
 import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.is;
-//TODO: below imports needs to be uncommented once TODO in DefaultPcePath class are removed
-//import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.notNullValue;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 
 import static org.onosproject.net.Link.Type.DIRECT;
 
-//import com.eclipsesource.json.Json;
-//import com.eclipsesource.json.JsonObject;
+import com.eclipsesource.json.Json;
+import com.eclipsesource.json.JsonObject;
 
 import java.io.InputStream;
 import java.net.HttpURLConnection;
@@ -64,6 +63,7 @@
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.Link;
 import org.onosproject.pce.pceservice.api.PceService;
+import org.onosproject.pce.pceservice.PcepAnnotationKeys;
 import org.onosproject.net.Path;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.provider.ProviderId;
@@ -158,10 +158,16 @@
        // Path
        path = new DefaultPath(providerId, linkList, 10);
 
+       // Annotations
+       DefaultAnnotations.Builder builderAnn = DefaultAnnotations.builder();
+       builderAnn.set(PcepAnnotationKeys.LSP_SIG_TYPE, "2");
+       builderAnn.set(PcepAnnotationKeys.COST_TYPE, "2");
+       builderAnn.set(PcepAnnotationKeys.BANDWIDTH, "200");
+
        // Tunnel
        tunnel = new DefaultTunnel(producerName, src, dst, Tunnel.Type.VXLAN,
                                   Tunnel.State.ACTIVE, groupId, tunnelId,
-                                  tunnelName, path);
+                                  tunnelName, path, builderAnn.build());
     }
 
     /**
@@ -190,16 +196,15 @@
      */
     @Test
     public void testGetTunnelId() {
-        //TODO: uncomment below lines once TODO in DefaultPcePath class are removed
-        //expect(pceService.queryPath(anyObject()))
-        //                 .andReturn(tunnel)
-        //                 .anyTimes();
-        //replay(pceService);
+        expect(pceService.queryPath(anyObject()))
+                         .andReturn(tunnel)
+                         .anyTimes();
+        replay(pceService);
 
-        //WebTarget wt = target();
-        //String response = wt.path("path/1").request().get(String.class);
-        //JsonObject result = Json.parse(response).asObject();
-        //assertThat(result, notNullValue());
+        WebTarget wt = target();
+        String response = wt.path("path/1").request().get(String.class);
+        JsonObject result = Json.parse(response).asObject();
+        assertThat(result, notNullValue());
     }
 
     /**
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java b/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java
index 2a75eaf..9de3194 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java
@@ -38,121 +38,99 @@
 
     @Override
     public void addListener(TunnelListener listener) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public void removeListener(TunnelListener listener) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
     public Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelName tunnelName,
                                            Annotations... annotations) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst,
                                            Annotations... annotations) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type,
                                            Annotations... annotations) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public TunnelId setupTunnel(ApplicationId producerId, ElementId srcElementId, Tunnel tunnel, Path path) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public boolean downTunnel(ApplicationId producerId, TunnelId tunnelId) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean returnTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean returnTunnel(ApplicationId consumerId, TunnelName tunnelName, Annotations... annotations) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type,
                                 Annotations... annotations) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst,
                                 Annotations... annotations) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public Tunnel queryTunnel(TunnelId tunnelId) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> queryTunnel(Type type) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public Collection<Tunnel> queryAllTunnels() {
-        // TODO Auto-generated method stub
         return null;
     }
 
     @Override
     public int tunnelCount() {
-        // TODO Auto-generated method stub
         return 0;
     }
 
     @Override
     public Iterable<Tunnel> getTunnels(DeviceId deviceId) {
-        // TODO Auto-generated method stub
         return null;
     }
-
 }
