Not allow null value for all control metrics, revise unit test

Current implementation allows null value from REST API.
Null metric value leads the metrics database to not store the value
properly. This commit tries to fix this issue.

Change-Id: I82a5fd0d11671db4d2136a3fc40090b7684ba91a
diff --git a/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java b/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
index aaab7a3..6fd8770 100644
--- a/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
+++ b/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
@@ -57,6 +57,15 @@
     private static final String PREFIX = "collector";
 
     /**
+     * Constructs a control metrics collector resource test instance.
+     */
+    public ControlMetricsCollectorResourceTest() {
+        super(new WebAppDescriptor.Builder("javax.ws.rs.Application",
+                CPManWebApplication.class.getCanonicalName())
+                .servletClass(ServletContainer.class).build());
+    }
+
+    /**
      * Sets up the global values for all the tests.
      */
     @Before
@@ -67,6 +76,9 @@
         BaseResource.setServiceDirectory(testDirectory);
     }
 
+    /**
+     * Tests CPU metrics POST through REST API.
+     */
     @Test
     public void testCpuMetricsPost() {
         mockControlPlaneMonitorService.updateMetric(anyObject(), anyInt(),
@@ -76,6 +88,9 @@
         basePostTest("cpu-metrics-post.json", PREFIX + "/cpu_metrics");
     }
 
+    /**
+     * Tests memory metrics POST through REST API.
+     */
     @Test
     public void testMemoryMetricsPost() {
         mockControlPlaneMonitorService.updateMetric(anyObject(), anyInt(),
@@ -85,16 +100,22 @@
         basePostTest("memory-metrics-post.json", PREFIX + "/memory_metrics");
     }
 
+    /**
+     * Tests disk metrics POST through REST API.
+     */
     @Test
-    public void testDiskMetricsWithNullName() {
+    public void testDiskMetrics() {
         mockControlPlaneMonitorService.updateMetric(anyObject(), anyInt(), anyString());
         expectLastCall().times(4);
         replay(mockControlPlaneMonitorService);
         basePostTest("disk-metrics-post.json", PREFIX + "/disk_metrics");
     }
 
+    /**
+     * Tests network metrics POST through REST API.
+     */
     @Test
-    public void testNetworkMetricsWithNullName() {
+    public void testNetworkMetrics() {
         mockControlPlaneMonitorService.updateMetric(anyObject(), anyInt(), anyString());
         expectLastCall().times(8);
         replay(mockControlPlaneMonitorService);
@@ -123,12 +144,6 @@
         assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));
     }
 
-    public ControlMetricsCollectorResourceTest() {
-        super(new WebAppDescriptor.Builder("javax.ws.rs.Application",
-                CPManWebApplication.class.getCanonicalName())
-                .servletClass(ServletContainer.class).build());
-    }
-
     /**
      * Assigns an available port for the test.
      *