From 5e0a551935151242e4308053617c2f487a60d5f0 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 07:31:26 +0000
Subject: [PATCH] Partial OPENDJ-3106 Migrate Entry

---
 opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index 286ac92..8472094 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -16,6 +16,17 @@
  */
 package org.opends.server.replication;
 
+import static java.util.concurrent.TimeUnit.*;
+
+import static org.forgerock.opendj.ldap.ModificationType.*;
+import static org.forgerock.opendj.ldap.ResultCode.*;
+import static org.forgerock.opendj.ldap.SearchScope.*;
+import static org.opends.server.backends.task.TaskState.*;
+import static org.opends.server.config.ConfigConstants.*;
+import static org.opends.server.protocols.internal.Requests.*;
+import static org.opends.server.util.CollectionUtils.*;
+import static org.testng.Assert.*;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -68,17 +79,6 @@
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-import static java.util.concurrent.TimeUnit.*;
-
-import static org.forgerock.opendj.ldap.ModificationType.*;
-import static org.forgerock.opendj.ldap.ResultCode.*;
-import static org.forgerock.opendj.ldap.SearchScope.*;
-import static org.opends.server.backends.task.TaskState.*;
-import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.protocols.internal.Requests.*;
-import static org.opends.server.util.CollectionUtils.*;
-import static org.testng.Assert.*;
-
 /** An abstract class that all Replication unit test should extend. */
 @SuppressWarnings("javadoc")
 @Test(groups = { "precommit", "replication" }, sequential = true)
@@ -524,9 +524,9 @@
       {
         final Entry newEntry = DirectoryServer.getEntry(dn);
         assertNotNull(newEntry);
-        List<Attribute> attrList = newEntry.getAllAttributes(attrTypeStr);
-        Assertions.assertThat(attrList).isNotEmpty();
-        Attribute attr = attrList.get(0);
+        Iterable<Attribute> attrs = newEntry.getAllAttributes(attrTypeStr);
+        Assertions.assertThat(attrs).isNotEmpty();
+        Attribute attr = attrs.iterator().next();
         boolean foundAttributeValue = attr.contains(ByteString.valueOfUtf8(valueString));
         assertEquals(foundAttributeValue, expectedAttributeValueFound, foundMsg);
         return null;
@@ -781,10 +781,10 @@
       {
         Entry newEntry = DirectoryServer.getEntry(dn);
         assertNotNull(newEntry);
-        Attribute attribute = newEntry.getAllAttributes("entryuuid").get(0);
-        String found = attribute.iterator().next().toString();
+        Attribute attribute = newEntry.getAllAttributes("entryuuid").iterator().next();
+        ByteString found = attribute.iterator().next();
         assertNotNull(found, "Entry: " + dn + " Could not be found.");
-        return found;
+        return found.toString();
       }
     });
   }

--
Gitblit v1.10.0