[view] moved generic test constant
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 07 Aug 2018 08:57:47 +0200
changeset 35076 d77908083eb4
parent 35075 2388b7bdd44a
child 35077 49614fbce94f
[view] moved generic test constant
src-test/src/org/openbravo/test/base/TestConstants.java
src-test/src/org/openbravo/test/views/ETagGeneration.java
--- a/src-test/src/org/openbravo/test/base/TestConstants.java	Tue Aug 07 08:48:24 2018 +0200
+++ b/src-test/src/org/openbravo/test/base/TestConstants.java	Tue Aug 07 08:57:47 2018 +0200
@@ -43,6 +43,10 @@
     public static final String C_ORDER = "259";
   }
 
+  public static class Windows {
+    public static final String SALES_ORDER = "143";
+  }
+
   private TestConstants() {
   }
 }
--- a/src-test/src/org/openbravo/test/views/ETagGeneration.java	Tue Aug 07 08:48:24 2018 +0200
+++ b/src-test/src/org/openbravo/test/views/ETagGeneration.java	Tue Aug 07 08:57:47 2018 +0200
@@ -37,20 +37,20 @@
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.test.base.TestConstants.Tables;
+import org.openbravo.test.base.TestConstants.Windows;
 import org.openbravo.test.datasource.BaseDataSourceTestDal;
 import org.openbravo.test.datasource.DatasourceTestUtil;
 
 /** Test cases covering ETag management for generated views */
 public class ETagGeneration extends BaseDataSourceTestDal {
-  private static final String SALES_ORDER_WINDOW = "143";
 
   @Test
   public void eTagShouldBeStable() throws Exception {
     assumeThat("Has modules in development", hasModulesInDevelopment(), is(false));
 
-    String eTag = getEtag(SALES_ORDER_WINDOW);
+    String eTag = getEtag(Windows.SALES_ORDER);
 
-    assertResponseCode("Response without changes", SALES_ORDER_WINDOW, eTag,
+    assertResponseCode("Response without changes", Windows.SALES_ORDER, eTag,
         HttpServletResponse.SC_NOT_MODIFIED);
   }
 
@@ -61,7 +61,7 @@
     Preference newPref = null;
     setSystemAdministratorContext();
     try {
-      String oldEtag = getEtag(SALES_ORDER_WINDOW);
+      String oldEtag = getEtag(Windows.SALES_ORDER);
 
       if (!Preferences.existsPreference("UomManagement", true, "0", "0", null, null, null)) {
         newPref = Preferences.setPreferenceValue("UomManagement", "Y", true, OBDal.getInstance()
@@ -70,13 +70,13 @@
       }
       OBDal.getInstance().commitAndClose();
 
-      String newEtag = getEtag(SALES_ORDER_WINDOW);
+      String newEtag = getEtag(Windows.SALES_ORDER);
       assertThat("ETag should change", newEtag, is(not(oldEtag)));
 
-      assertResponseCode("Response after adding server dl config", SALES_ORDER_WINDOW, oldEtag,
+      assertResponseCode("Response after adding server dl config", Windows.SALES_ORDER, oldEtag,
           HttpServletResponse.SC_OK);
       assertResponseCode("Response on 2nd request after change in dl server config",
-          SALES_ORDER_WINDOW, newEtag, HttpServletResponse.SC_NOT_MODIFIED);
+          Windows.SALES_ORDER, newEtag, HttpServletResponse.SC_NOT_MODIFIED);
     } finally {
       if (newPref != null) {
         OBDal.getInstance().remove(newPref);
@@ -91,19 +91,19 @@
     boolean wasAudited = false;
 
     try {
-      String oldEtag = getEtag(SALES_ORDER_WINDOW);
+      String oldEtag = getEtag(Windows.SALES_ORDER);
 
       Table orderTable = OBDal.getInstance().get(Table.class, Tables.C_ORDER);
       wasAudited = orderTable.isFullyAudited();
       orderTable.setFullyAudited(!wasAudited);
       OBDal.getInstance().commitAndClose();
 
-      String newEtag = getEtag(SALES_ORDER_WINDOW);
+      String newEtag = getEtag(Windows.SALES_ORDER);
       assertThat("ETag should change", newEtag, is(not(oldEtag)));
 
-      assertResponseCode("Response after adding server dl config", SALES_ORDER_WINDOW, oldEtag,
+      assertResponseCode("Response after adding server dl config", Windows.SALES_ORDER, oldEtag,
           HttpServletResponse.SC_OK);
-      assertResponseCode("Response on 2nd request after change audit config", SALES_ORDER_WINDOW,
+      assertResponseCode("Response on 2nd request after change audit config", Windows.SALES_ORDER,
           newEtag, HttpServletResponse.SC_NOT_MODIFIED);
     } finally {
       Table orderTable = OBDal.getInstance().get(Table.class, Tables.C_ORDER);