@@ -73,28 +73,6 @@ private void triggerSerializeAndWait(VertxTestContext testContext) throws JsonPr
7373 testContext .awaitCompletion (LOG_WAIT_INTERVAL , TimeUnit .MILLISECONDS );
7474 }
7575
76- @ Test
77- void testJSONSerializeWithV0AndV1Paths (Vertx vertx , VertxTestContext testContext ) throws InterruptedException , JsonProcessingException {
78- StatsCollectorMessageItem messageItem = new StatsCollectorMessageItem ("/test" , "https://test.com" , "test" , 1 , CLIENT_VERSION );
79- sendStatMessage (messageItem );
80- sendStatMessage (messageItem );
81- sendStatMessage (messageItem );
82-
83- messageItem = new StatsCollectorMessageItem ("/v1/test" , "https://test.com" , "test" , 1 , CLIENT_VERSION );
84- sendStatMessage (messageItem );
85- sendStatMessage (messageItem );
86- waitForLogInterval (testContext );
87-
88- triggerSerializeAndWait (testContext );
89-
90- var expectedList = List .of ("{\" endpoint\" :\" test\" ,\" siteId\" :1,\" apiVersion\" :\" v1\" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :2,\" apiContact\" :\" test\" }]}" ,
91- "{\" endpoint\" :\" test\" ,\" siteId\" :1,\" apiVersion\" :\" v0\" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :3,\" apiContact\" :\" test\" }]}" );
92- var messages = getMessages ();
93- assertThat (messages ).containsAll (expectedList );
94-
95- testContext .completeNow ();
96- }
97-
9876 private static void waitForLogInterval (VertxTestContext testContext ) throws InterruptedException {
9977 testContext .awaitCompletion (JSON_INTERVAL *2 , TimeUnit .MILLISECONDS );
10078 }
@@ -134,7 +112,7 @@ void allValidPathsAllowed(Vertx vertx, VertxTestContext testContext) throws Inte
134112 var messages = getMessages ();
135113 for (String endpoint : validEndpoints ) {
136114 String withoutVersion = endpoint ;
137- if (endpoint .startsWith ("/v1/" ) || endpoint . startsWith ( "/ v2/" ) || endpoint .startsWith ("/v3/" )) {
115+ if (endpoint .startsWith ("/v2/" ) || endpoint .startsWith ("/v3/" )) {
138116 withoutVersion = endpoint .substring (4 );
139117 } else if (endpoint .startsWith ("/" )) {
140118 withoutVersion = endpoint .substring (1 );
@@ -160,11 +138,11 @@ void invalidPathsLimit(Vertx vertx, VertxTestContext testContext) throws Interru
160138 var messages = getMessages ();
161139 // MAX_INVALID_PATHS is not the hard limit. The maximum paths that can be recorded, including valid ones, is MAX_INVALID_PATHS + validPaths.size * 2
162140 for (int i = 0 ; i < MAX_INVALID_PATHS + Endpoints .pathSet ().size (); i ++) {
163- String expected = "{\" endpoint\" :\" bad" + i + "\" ,\" siteId\" :1,\" apiVersion\" :\" v0 \" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :1,\" apiContact\" :\" test\" }]}" ;
141+ String expected = "{\" endpoint\" :\" bad" + i + "\" ,\" siteId\" :1,\" apiVersion\" :\" unknown \" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :1,\" apiContact\" :\" test\" }]}" ;
164142 assertThat (messages ).contains (expected );
165143 }
166144 for (int i = MAX_INVALID_PATHS + Endpoints .pathSet ().size (); i < MAX_INVALID_PATHS + 5 ; i ++) {
167- String expected = "{\" endpoint\" :\" bad" + i + "\" ,\" siteId\" :1,\" apiVersion\" :\" v0 \" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :1,\" apiContact\" :\" test\" }]}" ;
145+ String expected = "{\" endpoint\" :\" bad" + i + "\" ,\" siteId\" :1,\" apiVersion\" :\" unknown \" ,\" domainList\" :[{\" domain\" :\" test.com\" ,\" count\" :1,\" apiContact\" :\" test\" }]}" ;
168146 assertThat (messages ).contains (expected );
169147 }
170148 assertThat (getMessages ()).contains ("max invalid paths reached; a large number of invalid paths have been requested from authenticated participants" );
0 commit comments