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/tools/makeldif/MakeLDIFTestCase.java | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/tools/makeldif/MakeLDIFTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/tools/makeldif/MakeLDIFTestCase.java
index fa941cd..7fda1b9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/tools/makeldif/MakeLDIFTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/tools/makeldif/MakeLDIFTestCase.java
@@ -17,6 +17,10 @@
*/
package org.opends.server.tools.makeldif;
+import static org.assertj.core.api.Assertions.*;
+import static org.opends.messages.ToolMessages.*;
+import static org.testng.Assert.*;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -39,9 +43,6 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import static org.opends.messages.ToolMessages.*;
-import static org.testng.Assert.*;
-
/** A set of test cases for the MakeLDIF tool. */
@SuppressWarnings("javadoc")
public class MakeLDIFTestCase extends ToolsTestCase
@@ -316,9 +317,9 @@
Entry e = readEntry(outLdifFilePath);
assertNotNull(e);
- List<Attribute> attrs = e.getAllAttributes(attrName);
- assertFalse(attrs.isEmpty());
- Attribute a = attrs.get(0);
+ Iterable<Attribute> attrs = e.getAllAttributes(attrName);
+ assertThat(attrs).isNotEmpty();
+ Attribute a = attrs.iterator().next();
Attribute expectedRes = Attributes.create(attrName, expectedValue);
assertEquals(a, expectedRes);
}
@@ -365,9 +366,9 @@
Entry e = readEntry(outLdifFilePath);
assertNotNull(e);
- List<Attribute> attrs = e.getAllAttributes("cn");
- assertFalse(attrs.isEmpty());
- Attribute a = attrs.get(0);
+ Iterable<Attribute> attrs = e.getAllAttributes("cn");
+ assertThat(attrs).isNotEmpty();
+ Attribute a = attrs.iterator().next();
assertTrue(a.iterator().next().toString().matches("Foo <[A-Z]>\\{1\\}Bar"),
"cn value doesn't match the expected value");
}
--
Gitblit v1.10.0