JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / fts / core / FTSRestClientTest.java
index eae5575..2e9a5f4 100644 (file)
@@ -1,18 +1,48 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.fts.core;
 
 import jalview.fts.api.FTSDataColumnI;
 import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI;
+import jalview.gui.JvOptionPane;
 
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 public class FTSRestClientTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   private FTSRestClient ftsRestClient;
 
   @BeforeMethod(alwaysRun = true)
@@ -48,8 +78,8 @@ public class FTSRestClientTest
       foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields,
               false);
       Assert.assertEquals(foundIndex, 0);
-      foundIndex = ftsRestClient
-              .getPrimaryKeyColumIndex(wantedFields, true);
+      foundIndex = ftsRestClient.getPrimaryKeyColumIndex(wantedFields,
+              true);
       Assert.assertEquals(foundIndex, 1);
     } catch (Exception e)
     {
@@ -61,11 +91,12 @@ public class FTSRestClientTest
   @Test(groups = { "Functional" })
   public void getAllDefaulDisplayedDataColumns()
   {
-    Assert.assertNotNull(ftsRestClient.getAllDefaultDisplayedFTSDataColumns());
+    Assert.assertNotNull(
+            ftsRestClient.getAllDefaultDisplayedFTSDataColumns());
     Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
             .isEmpty());
-    Assert.assertEquals(ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
-            .size(), 7);
+    Assert.assertEquals(
+            ftsRestClient.getAllDefaultDisplayedFTSDataColumns().size(), 7);
   }
 
   @Test(groups = { "Functional" })
@@ -79,7 +110,6 @@ public class FTSRestClientTest
             "id,entry name,protein names,genes,organism,reviewed,length");
   }
 
-
   @Test(groups = { "Functional" })
   public void getAllFTSDataColumns()
   {
@@ -257,8 +287,8 @@ public class FTSRestClientTest
       actualGroupStr = ftsRestClient.getDataColumnGroupById("g4")
               .toString();
       Assert.assertEquals(actualGroupStr, "Procedures & Softwares");
-      actualGroupStr = ftsRestClient.getDataColumnGroupById(
-              "unavailable group").toString();
+      actualGroupStr = ftsRestClient
+              .getDataColumnGroupById("unavailable group").toString();
     } catch (Exception e)
     {
       Assert.assertTrue(true);