diff --git a/ali-plugin-main/src/test/java/com/hp/alm/ali/idea/rest/TroubleShootServiceTest.java b/ali-plugin-main/src/test/java/com/hp/alm/ali/idea/rest/TroubleShootServiceTest.java index 7e2acff..ec0c291 100644 --- a/ali-plugin-main/src/test/java/com/hp/alm/ali/idea/rest/TroubleShootServiceTest.java +++ b/ali-plugin-main/src/test/java/com/hp/alm/ali/idea/rest/TroubleShootServiceTest.java @@ -33,7 +33,6 @@ import org.junit.Before; import org.junit.Test; -import javax.swing.SwingUtilities; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; @@ -158,18 +157,9 @@ public void register(@NotNull String groupDisplayName, @NotNull NotificationDisp for(int i = 0; i < 100; i++) { troubleShootService.request(getProject(), "GET", new MyInputData(""), "defects/{0}", "0"); } - - try { - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - // additional 10 notifications - Assert.assertEquals(11, times.getValue()); - } - }); - } catch (Exception e) { - throw new RuntimeException(e); - } + testApplication.waitForBackgroundActivityToFinish(); + // additional 10 notifications + Assert.assertEquals(11, times.getValue()); connection.disconnect(); troubleShootService.stop();