From 74d6a0e420eaf417329ecbc280d88f4ad0d82a35 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 17 Aug 2015 11:55:34 +0000
Subject: [PATCH] ChangelogBackendTestCase.java: In assertChangelogAttributesInRootDSE(), removed always true parameter "isECLEnabled".

---
 opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java
index c2fea3b..48af749 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/ChangelogBackendTestCase.java
@@ -141,8 +141,8 @@
 
   /** The port of the replicationServer. */
   private int replicationServerPort;
-  private List<LDAPReplicationDomain> domains = new ArrayList<>();
-  private Map<ReplicaId, ReplicationBroker> brokers = new HashMap<>();
+  private final List<LDAPReplicationDomain> domains = new ArrayList<>();
+  private final Map<ReplicaId, ReplicationBroker> brokers = new HashMap<>();
 
   @BeforeClass
   @Override
@@ -276,7 +276,7 @@
         csns[3], cookies[3]);
     assertResultsContainCookieControl(searchOp, cookies);
 
-    assertChangelogAttributesInRootDSE(true, 1, 4);
+    assertChangelogAttributesInRootDSE(1, 4);
 
     debugInfo(test, "Ending search with success");
   }
@@ -573,7 +573,7 @@
     CSN[] csns = generateAndPublishUpdateMsgForEachOperationType(testName, false);
     searchChangesForEachOperationTypeUsingChangeNumberMode(firstChangeNumber, csns, testName);
 
-    assertChangelogAttributesInRootDSE(true, 1, 4);
+    assertChangelogAttributesInRootDSE(1, 4);
 
     debugInfo(testName, "Ending search with success");
   }
@@ -600,8 +600,7 @@
     // search from a provided change number interval: 5-7
     searchChangelogFromToChangeNumber(5,7);
 
-    // check first and last change number
-    assertChangelogAttributesInRootDSE(true, 1, 8);
+    assertChangelogAttributesInRootDSE(1, 8);
 
     // add a new change, then check again first and last change number without previous search
     testName = "Multiple/9";
@@ -609,7 +608,7 @@
     CSN csn = new CSN(lastCsn.getTime() + 1, 9, SERVER_ID_1);
     publishUpdateMessagesInOTest(testName, false, generateDeleteMsg(DN_OTEST, csn, testName, 1));
 
-    assertChangelogAttributesInRootDSE(true, 1, 9);
+    assertChangelogAttributesInRootDSE(1, 9);
   }
 
   /** Verifies that is not possible to read the changelog without the changelog-read privilege. */
@@ -846,7 +845,7 @@
     assertChangeNumberRange(range, -1, -1);
   }
 
-  private List<SearchResultEntry> assertChangelogAttributesInRootDSE(boolean isECLEnabled,
+  private List<SearchResultEntry> assertChangelogAttributesInRootDSE(
       int expectedFirstChangeNumber, int expectedLastChangeNumber) throws Exception
   {
     AssertionError error = null;
@@ -868,25 +867,13 @@
         assertThat(entries).hasSize(1);
 
         final SearchResultEntry entry = entries.get(0);
-        if (isECLEnabled)
+        if (expectedFirstChangeNumber > 0)
         {
-          if (expectedFirstChangeNumber > 0)
-          {
-            assertAttributeValue(entry, "firstchangenumber", expectedFirstChangeNumber);
-          }
-          assertAttributeValue(entry, "lastchangenumber", expectedLastChangeNumber);
-          assertAttributeValue(entry, "changelog", "cn=changelog");
-          assertNotNull(getAttributeValue(entry, "lastExternalChangelogCookie"));
+          assertAttributeValue(entry, "firstchangenumber", expectedFirstChangeNumber);
         }
-        else
-        {
-          if (expectedFirstChangeNumber > 0) {
-            assertNull(getAttributeValue(entry, "firstchangenumber"));
-          }
-          assertNull(getAttributeValue(entry, "lastchangenumber"));
-          assertNull(getAttributeValue(entry, "changelog"));
-          assertNull(getAttributeValue(entry, "lastExternalChangelogCookie"));
-        }
+        assertAttributeValue(entry, "lastchangenumber", expectedLastChangeNumber);
+        assertAttributeValue(entry, "changelog", "cn=changelog");
+        assertNotNull(getAttributeValue(entry, "lastExternalChangelogCookie"));
         return entries;
       }
       catch (AssertionError ae)

--
Gitblit v1.10.0