Skip to content

Commit 194ed6c

Browse files
committed
test clean up
1 parent b4ebd2e commit 194ed6c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

client/src/test/java/org/asynchttpclient/ws/RedirectTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
import static org.asynchttpclient.Dsl.*;
1717
import static org.asynchttpclient.test.TestUtils.*;
18-
import static org.testng.Assert.assertEquals;
18+
import static org.testng.Assert.*;
1919

2020
import java.io.IOException;
2121
import java.util.concurrent.CountDownLatch;
22-
import java.util.concurrent.atomic.AtomicReference;
22+
import java.util.concurrent.atomic.AtomicBoolean;
2323

2424
import javax.servlet.ServletException;
2525
import javax.servlet.http.HttpServletRequest;
@@ -72,17 +72,17 @@ public void configure(WebSocketServletFactory factory) {
7272
}
7373

7474

75-
@Test(groups = "standalone", timeOut = 60000)
75+
@Test(groups = "standalone")
7676
public void testRedirectToWSResource() throws Exception {
7777
try (AsyncHttpClient c = asyncHttpClient(config().setFollowRedirect(true))) {
7878
final CountDownLatch latch = new CountDownLatch(1);
79-
final AtomicReference<String> text = new AtomicReference<>("");
79+
final AtomicBoolean onOpenCalled = new AtomicBoolean();
8080

8181
WebSocket websocket = c.prepareGet(getRedirectURL()).execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketListener() {
8282

8383
@Override
8484
public void onOpen(WebSocket websocket) {
85-
text.set("OnOpen");
85+
onOpenCalled.set(true);
8686
latch.countDown();
8787
}
8888

@@ -98,7 +98,7 @@ public void onError(Throwable t) {
9898
}).build()).get();
9999

100100
latch.await();
101-
assertEquals(text.get(), "OnOpen");
101+
assertTrue(onOpenCalled.get());
102102
websocket.close();
103103
}
104104
}

0 commit comments

Comments
 (0)