changeset 1142:bd85413f06cb

minor
author Devel 1
date Wed, 10 Jun 2020 10:37:17 +0200
parents c4c4625a8523
children 1947030b8b3d
files stress-tester/src/test/java/com/passus/st/scanner/HttpUrlStatsMetricTest.java
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/test/java/com/passus/st/scanner/HttpUrlStatsMetricTest.java	Wed Jun 10 10:37:05 2020 +0200
+++ b/stress-tester/src/test/java/com/passus/st/scanner/HttpUrlStatsMetricTest.java	Wed Jun 10 10:37:17 2020 +0200
@@ -1,6 +1,5 @@
 package com.passus.st.scanner;
 
-import com.passus.commons.metric.Metric;
 import com.passus.st.utils.TestResourceUtils;
 import java.io.BufferedReader;
 import java.io.File;
@@ -40,9 +39,6 @@
         assertEquals(155, cleaned.get(".css").intValue());
         assertEquals(613, sumValues(cleaned));
 
-//        HashMap<String, MutableInt> urls = (HashMap<String, MutableInt>) instance.getAttributeValue("urls");
-//        assertEquals(9387, sumValues(urls));
-
         HashMap<String, MutableInt> paths = (HashMap<String, MutableInt>) instance.getAttributeValue("paths");
         assertEquals(4091, paths.get("/ably").intValue());
         assertEquals(24, paths.get("/users/sign_in").intValue());
@@ -87,13 +83,14 @@
         return result;
     }
 
-//    @Test
-    public void testUpdate() {
-        Metric metric = null;
+    @Test
+    public void testAddUrl_emptyQuery() {
         HttpUrlStatsMetric instance = new HttpUrlStatsMetric();
-        instance.update(metric);
-        instance.reset();
-        fail("The test case is a prototype.");
+        instance.addUrl("/path?");
+        HashMap<String, MutableInt> paths = (HashMap<String, MutableInt>) instance.getAttributeValue("paths");
+        assertEquals(1, paths.size());
+        HashMap<String, MutableInt> keys = (HashMap<String, MutableInt>) instance.getAttributeValue("keys");
+        assertEquals(0, keys.size());
     }
 
 }