Skip to content

Commit

Permalink
Fix ProxyLookupThrottlingTest (apache#5639)
Browse files Browse the repository at this point in the history
*Motivation*

ProxyLookupThrottlingTest relies on the number of permits for testing the behavior of current lookup.
We should reset the proxyService for each run.

*Modifications*

Change the setup and cleanup methods from `BeforeClass/AfterClass` to `BeforeMethod/AfterMethod`.
  • Loading branch information
sijie authored Nov 19, 2019
1 parent 9dd8dfd commit 1ec3cf4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class ProxyLookupThrottlingTest extends MockedPulsarServiceBaseTest {
Expand All @@ -45,7 +47,7 @@ public class ProxyLookupThrottlingTest extends MockedPulsarServiceBaseTest {
private ProxyConfiguration proxyConfig = new ProxyConfiguration();

@Override
@BeforeClass
@BeforeMethod
protected void setup() throws Exception {
internalSetup();

Expand All @@ -64,7 +66,7 @@ protected void setup() throws Exception {
}

@Override
@AfterClass
@AfterMethod
protected void cleanup() throws Exception {
internalCleanup();
proxyService.close();
Expand Down

0 comments on commit 1ec3cf4

Please sign in to comment.