Skip to content

Commit

Permalink
Add missing package import in PortalRegistryTest.java (#862)
Browse files Browse the repository at this point in the history
* Add unregistry for subAndUnsubService() method

* Update PortalRegistryTest.java

* Add unregistry & unavailable code

* Add import ignore

* Update PortalRegistryTest.java

* Update ConsulRegistryTest.java

* Update PortalRegistryTest.java
  • Loading branch information
KellyShao committed Dec 11, 2020
1 parent e1e8486 commit 513b66d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ public void discoverService() throws Exception {
urls = registry.discover(serviceUrl);
Assert.assertTrue(urls.contains(serviceUrl));

// unavailable
// unavailable & unregister
registry.doUnavailable(null);
Thread.sleep(sleepTime);
Assert.assertFalse(client.isWorking(serviceid));
registry.doUnregister(serviceUrl);
}

private Boolean containsNotifyListener(URL serviceUrl, URL clientUrl, NotifyListener listener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import java.util.Iterator;
Expand Down Expand Up @@ -126,10 +127,10 @@ public void discoverService() throws Exception {
}
Assert.assertTrue(urls.contains(serviceUrl));

// unavailable
// unavailable & unregister
registry.doUnavailable(null);
Thread.sleep(sleepTime);
Assert.assertFalse(client.isWorking(serviceid));
registry.doUnregister(serviceUrl);
}

@Test
Expand Down

0 comments on commit 513b66d

Please sign in to comment.