JAL-4199 Set all setup methods to alwaysRun mmw/JAL-4199-web-services-testing
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 8 Sep 2023 14:25:28 +0000 (16:25 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 8 Sep 2023 14:25:28 +0000 (16:25 +0200)
test/jalview/ws2/actions/alignment/AlignmentActionTest.java
test/jalview/ws2/client/slivka/SlivkaWSDiscovererTest.java

index 300eb6d..1725045 100644 (file)
@@ -1,5 +1,19 @@
 package jalview.ws2.actions.alignment;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.hasProperty;
+import static org.hamcrest.Matchers.is;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyList;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import java.io.IOException;
 import java.net.URL;
 import java.util.List;
@@ -8,7 +22,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.help.UnsupportedOperationException;
 
-import org.hamcrest.BaseMatcher;
 import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeMatcher;
@@ -18,13 +31,11 @@ import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignViewport;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.ws.params.ParamDatastoreI;
-import jalview.ws2.actions.api.JobI;
 import jalview.ws2.actions.api.TaskEventListener;
 import jalview.ws2.api.Credentials;
 import jalview.ws2.api.JobStatus;
@@ -32,13 +43,6 @@ import jalview.ws2.api.WebService;
 import jalview.ws2.api.WebServiceJobHandle;
 import jalview.ws2.client.api.AlignmentWebServiceClientI;
 
-import org.mockito.hamcrest.MockitoHamcrest;
-import org.mockito.internal.hamcrest.HamcrestArgumentMatcher;
-
-import static org.mockito.Mockito.*;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-
 public class AlignmentActionTest
 {
   protected AlignmentWebServiceClientI mockClient;
@@ -47,7 +51,7 @@ public class AlignmentActionTest
 
   protected WebServiceJobHandle jobRef;
 
-  @BeforeMethod
+  @BeforeMethod(alwaysRun = true)
   public void setupMockClient() throws IOException
   {
     jobRef = new WebServiceJobHandle(
@@ -61,7 +65,7 @@ public class AlignmentActionTest
     doThrow(new UnsupportedOperationException()).when(mockClient).cancel(any());
   }
 
-  @BeforeMethod(dependsOnMethods = { "setupMockClient" })
+  @BeforeMethod(alwaysRun = true, dependsOnMethods = { "setupMockClient" })
   public void setupActionBuilder() throws IOException
   {
     actionBuilder = AlignmentAction.newBuilder(mockClient);
@@ -233,7 +237,7 @@ class AlignmentActionListenerNotifiedTest extends AlignmentActionTest
 {
   private AlignViewport viewport;
 
-  @BeforeMethod
+  @BeforeMethod(alwaysRun = true)
   public void setupViewport()
   {
     viewport = new AlignViewport(new Alignment(new SequenceI[] {
index 6824a10..b8d0a31 100644 (file)
@@ -1,7 +1,15 @@
 package jalview.ws2.client.slivka;
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasProperty;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.Matchers.typeCompatibleWith;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -50,7 +58,7 @@ public class SlivkaWSDiscovererTest
     Console.initLogger();
   }
 
-  @BeforeMethod
+  @BeforeMethod(alwaysRun = true)
   public void setupDiscoverer() throws IOException
   {
     clientMock = mock(SlivkaClient.class);