Skip to content

Commit

Permalink
Merge branch 'my-version1' of https://github.com/youyulan/apollo into…
Browse files Browse the repository at this point in the history
… my-version1
  • Loading branch information
youyulan committed Nov 26, 2021
2 parents 16904e7 + 2f73515 commit f5a46ca
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,10 @@ public void testAssembleLongPollRefreshUrl() throws Exception {
assertTrue(longPollRefreshUrl.contains(someServerUrl + "/notifications/v2?"));
assertTrue(longPollRefreshUrl.contains("appId=" + someAppId));
assertTrue(longPollRefreshUrl.contains("cluster=someCluster%2B+%26.-_someSign"));
assertTrue(longPollRefreshUrl.contains(
"notifications=%5B%7B%22namespaceName%22%3A%22" + someNamespace
+ "%22%2C%22notificationId%22%3A" + 1 + "%7D%5D"));
assertTrue(longPollRefreshUrl.contains("notifications=%5B%7B")
&& longPollRefreshUrl.contains("%22namespaceName%22%3A%22" + someNamespace + "%22")
&& longPollRefreshUrl.contains("%22notificationId%22%3A" + someNotificationId)
&& longPollRefreshUrl.contains("%7D%5D"));
}

@Test
Expand All @@ -532,11 +533,12 @@ public void testAssembleLongPollRefreshUrlWithMultipleNamespaces() throws Except
assertTrue(longPollRefreshUrl.contains(someServerUrl + "/notifications/v2?"));
assertTrue(longPollRefreshUrl.contains("appId=" + someAppId));
assertTrue(longPollRefreshUrl.contains("cluster=someCluster%2B+%26.-_someSign"));
assertTrue(
longPollRefreshUrl.contains("notifications=%5B%7B%22namespaceName%22%3A%22" + someNamespace
+ "%22%2C%22notificationId%22%3A" + someNotificationId
+ "%7D%2C%7B%22namespaceName%22%3A%22" + anotherNamespace
+ "%22%2C%22notificationId%22%3A" + anotherNotificationId + "%7D%5D"));
assertTrue(longPollRefreshUrl.contains("notifications=%5B%7B")
&& longPollRefreshUrl.contains("%22namespaceName%22%3A%22" + someNamespace + "%22")
&& longPollRefreshUrl.contains("%22notificationId%22%3A" + someNotificationId)
&& longPollRefreshUrl.contains("%22namespaceName%22%3A%22" + anotherNamespace + "%22")
&& longPollRefreshUrl.contains("%22notificationId%22%3A" + anotherNotificationId)
&& longPollRefreshUrl.contains("%7D%5D"));
}

public static class MockConfigUtil extends ConfigUtil {
Expand Down

0 comments on commit f5a46ca

Please sign in to comment.