-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dubbo-7375]fix url add repeatedly (#7376)
* fix url add repeatedly * use iterator to traverse parameters map * remove unused import * import static CommonConstants.TIMESTAMP_KEY Co-authored-by: changye <[email protected]>
- Loading branch information
Showing
2 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -921,6 +921,27 @@ public void testEquals() { | |
assertNotEquals(url3, url4); | ||
} | ||
|
||
@Test | ||
public void testHashcode() { | ||
URL url1 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" + | ||
"dubbo-demo-api-consumer&category=consumers&check=false&dubbo=2.0.2&generic=true&interface=" + | ||
"org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false×tamp=1599556506417"); | ||
URL url2 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" + | ||
"dubbo-demo-api-consumer&category=consumers&check=false&dubbo=2.0.2&generic=true&interface=" + | ||
"org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false×tamp=2299556506417"); | ||
assertEquals(url1.hashCode(), url2.hashCode()); | ||
|
||
URL url3 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" + | ||
"dubbo-demo-api-consumer&category=consumers&check=false&dubbo=2.0.2&interface=" + | ||
"org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false×tamp=2299556506417"); | ||
assertNotEquals(url2.hashCode(), url3.hashCode()); | ||
|
||
URL url4 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" + | ||
"dubbo-demo-api-consumer&category=consumers&check=true&dubbo=2.0.2&interface=" + | ||
"org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false×tamp=2299556506417"); | ||
assertNotEquals(url3.hashCode(), url4.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testEqualsWithPassword() { | ||
URL url1 = URL.valueOf("ad@min:hello@[email protected]:20880/context/path?version=1.0.0&application=morgan"); | ||
|